noloader / cryptopp-cmake

CMake files for Crypto++ project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It looks like CMake does not support MinGW32

jayjupdhig opened this issue · comments

Can't compile an application that uses Crypto++ in the most current version 7.0.

The compiler i use is mingw32, the development environment is eclipse ide for c/c++ developers version "photon release 4.8.0"

09:58:28 **** Build of configuration Release for project MACAddressToPiUserPassword ****
make all 
Building file: ../indiv-build/CMakeFiles/3.6.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"indiv-build/CMakeFiles/3.6.2/CompilerIdCXX/CMakeCXXCompilerId.d" -MT"indiv-build/CMakeFiles/3.6.2/CompilerIdCXX/CMakeCXXCompilerId.o" -o "indiv-build/CMakeFiles/3.6.2/CompilerIdCXX/CMakeCXXCompilerId.o" "../indiv-build/CMakeFiles/3.6.2/CompilerIdCXX/CMakeCXXCompilerId.cpp"
Finished building: ../indiv-build/CMakeFiles/3.6.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
 
Building file: ../indiv-build/CMakeFiles/3.6.2/CompilerIdC/CMakeCCompilerId.c
Invoking: Cross GCC Compiler
gcc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"indiv-build/CMakeFiles/3.6.2/CompilerIdC/CMakeCCompilerId.d" -MT"indiv-build/CMakeFiles/3.6.2/CompilerIdC/CMakeCCompilerId.o" -o "indiv-build/CMakeFiles/3.6.2/CompilerIdC/CMakeCCompilerId.o" "../indiv-build/CMakeFiles/3.6.2/CompilerIdC/CMakeCCompilerId.c"
Finished building: ../indiv-build/CMakeFiles/3.6.2/CompilerIdC/CMakeCCompilerId.c
 
Building file: ../indiv-build/CMakeFiles/feature_tests.c
Invoking: Cross GCC Compiler
gcc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"indiv-build/CMakeFiles/feature_tests.d" -MT"indiv-build/CMakeFiles/feature_tests.o" -o "indiv-build/CMakeFiles/feature_tests.o" "../indiv-build/CMakeFiles/feature_tests.c"
Finished building: ../indiv-build/CMakeFiles/feature_tests.c
 
Building file: ../include/crypto++/3way.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"include/crypto++/3way.d" -MT"include/crypto++/3way.o" -o "include/crypto++/3way.o" "../include/crypto++/3way.cpp"
Finished building: ../include/crypto++/3way.cpp
 
Building file: ../include/crypto++/adler32.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"include/crypto++/adler32.d" -MT"include/crypto++/adler32.o" -o "include/crypto++/adler32.o" "../include/crypto++/adler32.cpp"
Finished building: ../include/crypto++/adler32.cpp
 
Building file: ../include/crypto++/algebra.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"include/crypto++/algebra.d" -MT"include/crypto++/algebra.o" -o "include/crypto++/algebra.o" "../include/crypto++/algebra.cpp"
Finished building: ../include/crypto++/algebra.cpp
 
Building file: ../include/crypto++/algparam.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"include/crypto++/algparam.d" -MT"include/crypto++/algparam.o" -o "include/crypto++/algparam.o" "../include/crypto++/algparam.cpp"
Finished building: ../include/crypto++/algparam.cpp
 
Building file: ../include/crypto++/arc4.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"include/crypto++/arc4.d" -MT"include/crypto++/arc4.o" -o "include/crypto++/arc4.o" "../include/crypto++/arc4.cpp"
Finished building: ../include/crypto++/arc4.cpp
 
Building file: ../include/crypto++/aria-simd.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"include/crypto++/aria-simd.d" -MT"include/crypto++/aria-simd.o" -o "include/crypto++/aria-simd.o" "../include/crypto++/aria-simd.cpp"
../include/crypto++/aria-simd.cpp: In function 'void CryptoPP::ARIA_ProcessAndXorBlock_Xor_SSSE3(const byte*, CryptoPP::byte*, const byte*, CryptoPP::word32*)':
../include/crypto++/aria-simd.cpp:122:76: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
  const __m128i MASK = _mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3);
                                                                            ^
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:714:1: error: inlining failed in call to always_inline 'void _mm_storeu_si128(__m128i*, __m128i)': target specific option mismatch
 _mm_storeu_si128 (__m128i *__P, __m128i __B)
 ^~~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:144:65: note: called from here
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
                                                                 ^
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:1286:1: error: inlining failed in call to always_inline '__m128i _mm_xor_si128(__m128i, __m128i)': target specific option mismatch
 _mm_xor_si128 (__m128i __A, __m128i __B)
 ^~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:696:1: error: inlining failed in call to always_inline '__m128i _mm_loadu_si128(const __m128i*)': target specific option mismatch
 _mm_loadu_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../include/crypto++/aria-simd.cpp:14:0:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:136:1: error: inlining failed in call to always_inline '__m128i _mm_shuffle_epi8(__m128i, __m128i)': target specific option mismatch
 _mm_shuffle_epi8 (__m128i __X, __m128i __Y)
 ^~~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:690:1: error: inlining failed in call to always_inline '__m128i _mm_load_si128(const __m128i*)': target specific option mismatch
 _mm_load_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:611:1: error: inlining failed in call to always_inline '__m128i _mm_set_epi8(char, char, char, char, char, char, char, char, char, char, char, char, char, char, char, char)': target specific option mismatch
 _mm_set_epi8 (char __q15, char __q14, char __q13, char __q12,
 ^~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:122:76: note: called from here
  const __m128i MASK = _mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3);
                                                                            ^
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:714:1: error: inlining failed in call to always_inline 'void _mm_storeu_si128(__m128i*, __m128i)': target specific option mismatch
 _mm_storeu_si128 (__m128i *__P, __m128i __B)
 ^~~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:152:49: note: called from here
     _mm_loadu_si128(CONST_M128_CAST(xorBlock))));
                                                 ^
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:1286:1: error: inlining failed in call to always_inline '__m128i _mm_xor_si128(__m128i, __m128i)': target specific option mismatch
 _mm_xor_si128 (__m128i __A, __m128i __B)
 ^~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:149:19: note: called from here
   _mm_storeu_si128(M128_CAST(outBlock),
   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    _mm_xor_si128(
    ~~~~~~~~~~~~~~  
     _mm_loadu_si128(CONST_M128_CAST(outBlock)),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     _mm_loadu_si128(CONST_M128_CAST(xorBlock))));
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:696:1: error: inlining failed in call to always_inline '__m128i _mm_loadu_si128(const __m128i*)': target specific option mismatch
 _mm_loadu_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:149:19: note: called from here
   _mm_storeu_si128(M128_CAST(outBlock),
   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    _mm_xor_si128(
    ~~~~~~~~~~~~~~  
     _mm_loadu_si128(CONST_M128_CAST(outBlock)),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     _mm_loadu_si128(CONST_M128_CAST(xorBlock))));
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:696:1: error: inlining failed in call to always_inline '__m128i _mm_loadu_si128(const __m128i*)': target specific option mismatch
 _mm_loadu_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:149:19: note: called from here
   _mm_storeu_si128(M128_CAST(outBlock),
   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    _mm_xor_si128(
    ~~~~~~~~~~~~~~  
     _mm_loadu_si128(CONST_M128_CAST(outBlock)),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     _mm_loadu_si128(CONST_M128_CAST(xorBlock))));
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:714:1: error: inlining failed in call to always_inline 'void _mm_storeu_si128(__m128i*, __m128i)': target specific option mismatch
 _mm_storeu_si128 (__m128i *__P, __m128i __B)
 ^~~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:144:65: note: called from here
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
                                                                 ^
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:1286:1: error: inlining failed in call to always_inline '__m128i _mm_xor_si128(__m128i, __m128i)': target specific option mismatch
 _mm_xor_si128 (__m128i __A, __m128i __B)
 ^~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:696:1: error: inlining failed in call to always_inline '__m128i _mm_loadu_si128(const __m128i*)': target specific option mismatch
 _mm_loadu_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../include/crypto++/aria-simd.cpp:14:0:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:136:1: error: inlining failed in call to always_inline '__m128i _mm_shuffle_epi8(__m128i, __m128i)': target specific option mismatch
 _mm_shuffle_epi8 (__m128i __X, __m128i __Y)
 ^~~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:690:1: error: inlining failed in call to always_inline '__m128i _mm_load_si128(const __m128i*)': target specific option mismatch
 _mm_load_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:611:1: error: inlining failed in call to always_inline '__m128i _mm_set_epi8(char, char, char, char, char, char, char, char, char, char, char, char, char, char, char, char)': target specific option mismatch
 _mm_set_epi8 (char __q15, char __q14, char __q13, char __q12,
 ^~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:122:76: note: called from here
  const __m128i MASK = _mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3);
                                                                            ^
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:714:1: error: inlining failed in call to always_inline 'void _mm_storeu_si128(__m128i*, __m128i)': target specific option mismatch
 _mm_storeu_si128 (__m128i *__P, __m128i __B)
 ^~~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:144:65: note: called from here
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
                                                                 ^
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:1286:1: error: inlining failed in call to always_inline '__m128i _mm_xor_si128(__m128i, __m128i)': target specific option mismatch
 _mm_xor_si128 (__m128i __A, __m128i __B)
 ^~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:696:1: error: inlining failed in call to always_inline '__m128i _mm_loadu_si128(const __m128i*)': target specific option mismatch
 _mm_loadu_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../include/crypto++/aria-simd.cpp:14:0:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:136:1: error: inlining failed in call to always_inline '__m128i _mm_shuffle_epi8(__m128i, __m128i)': target specific option mismatch
 _mm_shuffle_epi8 (__m128i __X, __m128i __Y)
 ^~~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:690:1: error: inlining failed in call to always_inline '__m128i _mm_load_si128(const __m128i*)': target specific option mismatch
 _mm_load_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:142:18: note: called from here
  _mm_storeu_si128(M128_CAST(outBlock),
  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
   _mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    _mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:714:1: error: inlining failed in call to always_inline 'void _mm_storeu_si128(__m128i*, __m128i)': target specific option mismatch
 _mm_storeu_si128 (__m128i *__P, __m128i __B)
 ^~~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:152:49: note: called from here
     _mm_loadu_si128(CONST_M128_CAST(xorBlock))));
                                                 ^
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:1286:1: error: inlining failed in call to always_inline '__m128i _mm_xor_si128(__m128i, __m128i)': target specific option mismatch
 _mm_xor_si128 (__m128i __A, __m128i __B)
 ^~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:149:19: note: called from here
   _mm_storeu_si128(M128_CAST(outBlock),
   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    _mm_xor_si128(
    ~~~~~~~~~~~~~~  
     _mm_loadu_si128(CONST_M128_CAST(outBlock)),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     _mm_loadu_si128(CONST_M128_CAST(xorBlock))));
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:696:1: error: inlining failed in call to always_inline '__m128i _mm_loadu_si128(const __m128i*)': target specific option mismatch
 _mm_loadu_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:149:19: note: called from here
   _mm_storeu_si128(M128_CAST(outBlock),
   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    _mm_xor_si128(
    ~~~~~~~~~~~~~~  
     _mm_loadu_si128(CONST_M128_CAST(outBlock)),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     _mm_loadu_si128(CONST_M128_CAST(xorBlock))));
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\pmmintrin.h:31:0,
                 from c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\tmmintrin.h:31,
                 from ../include/crypto++/aria-simd.cpp:14:
c:\development\compilers\c++\minigw\lib\gcc\mingw32\6.3.0\include\emmintrin.h:696:1: error: inlining failed in call to always_inline '__m128i _mm_loadu_si128(const __m128i*)': target specific option mismatch
 _mm_loadu_si128 (__m128i const *__P)
 ^~~~~~~~~~~~~~~
../include/crypto++/aria-simd.cpp:149:19: note: called from here
   _mm_storeu_si128(M128_CAST(outBlock),
   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    _mm_xor_si128(
    ~~~~~~~~~~~~~~  
     _mm_loadu_si128(CONST_M128_CAST(outBlock)),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     _mm_loadu_si128(CONST_M128_CAST(xorBlock))));
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [include/crypto++/aria-simd.o] Error 1

09:58:43 Build Failed. 26 errors, 1 warnings. (took 15s.406ms)

It looks like we are misdetecting features under MinGW. aria-simd.cpp should have been built with -mssse3.

Ping @abdes, @MarcelRaad and @jcfr. I seem to recall @anonimal and I had a lot of trouble with feature tests using CMake on MinGW. MinGW required the shell tests to happen with sh -c ....


If I had to hazard a guess I'd say the compiler string is being misdetected around Cmakelist.txt: 470:

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")

  if (CRYPTOPP_AMD64 OR CRYPTOPP_I386 OR CRYPTOPP_X32)

    CheckCompilerOption("-msse2" CRYPTOPP_IA32_SSE2)
    CheckCompilerOption("-mssse3" CRYPTOPP_IA32_SSSE3)
    CheckCompilerOption("-msse4.1" CRYPTOPP_IA32_SSE41)
    CheckCompilerOption("-msse4.2" CRYPTOPP_IA32_SSE42)
    CheckCompilerOption("-mssse3 -mpclmul" CRYPTOPP_IA32_CLMUL)
    CheckCompilerOption("-msse4.1 -maes" CRYPTOPP_IA32_AES)
    CheckCompilerOption("-msse4.2 -msha" CRYPTOPP_IA32_SHA)
    CheckCompilerOption("-march=native" CRYPTOPP_IA32_NATIVE)
    ...

Attempting to reproduce on MinGW32 using msys2-i686-20180531.exe on Windows 8.1 results in hangs. The test below is slightly different than @martijintro case. The test below was run against master of both cryptopp and cryptopp-cmake:

$ git clone https://github.com/weidai11/cryptopp
$ cd cryptopp
$ cp TestScripts/cryptest-cmake.sh .
$ ./cryptest-cmake.sh

mingw32-cmake

To build using MinGW32, I suggest to use the corresponding generator: https://cmake.org/cmake/help/latest/generator/MinGW%20Makefiles.html

This means the option -G "MinGW Makefiles" would have to be passed.

The following script should probably be updated: https://github.com/weidai11/cryptopp/blob/master/TestScripts/cryptest-cmake.sh

thx

Thanks @jcfr,

We publish a procedure to use CMake on the wiki. The extra steps for MinGW makes me uncomfortable because it means we have to teach users about special cases and additional procedures.

I'm also not a fan of RTFM for the common case. For the common case things should just work.

Is there anything that can be done in CMakefile.txt so we don't have special cases and multiple procedures?

Thank you for your feedback, will look at it!

@noloader

The intsructions on the wiki lean on CMake's "platform default" generator. The platform default is set when cmake is built, and there's no configuration option to change it per-system.

If a user wishes to build with something that's not the platform default, there's no way to avoid specifying it on the command line.

By the time CMakeLists.txt gets parsed, CMake has proceeded past the point of setting the generator; no tricks in there will let you alter it.

For the truly common case, the default will work. Short of writing some kind of cmake-running wrapper script I don't see a way to avoid RTFM and get cmake to use non-default compilers.

We publish a procedure to use CMake on the wiki. The extra steps for MinGW makes me uncomfortable because it means we have to teach users about special cases and additional procedures.

It is generally difficult to "guess" which generator user would like to use. For example, on windows it could be Visual Studio 14 2015, Visual Studio 14 2015 win64, ..., Visual Studio 15 2017 Win64, MinGW Makefiles, NMake Makefiles, Ninja ... also worth noting that on windows, you can select different toolset with Visual Studio (e.g v140, v141, ...)

Also worth noting that the procedure documenting on the wiki assume that everyone is using a "single configuration" environment, but it may be sensible to account for Visual Studio and XCode users. In that case, you do not specify CMAKE_BUILD_TYPE are configure time but instead select the configuration at build time.

@geoffbeier, @jcfr,

Is it possible to detect the platform and print a message before the terminal hangs? That should avoid mailing list messages and bug reports.

Here's what I am seeing on a hello world project using msys2-i686-20180531.exe :

$ cat CMakeLists.txt
cmake_minimum_required (VERSION 2.9)
project (HELLO CXX)
add_executable(HELLO hello.cxx)
message("CXX: ${CXX}")

$ cat hello.cxx
#include <iostream>
int main(int argc, char* argv[])
{
  std::cout << "test" << std::endl;
  return 0;
}

$ c++ --version
c++ (GCC) 7.3.0

cmake-hang

I kind of feel like we need to work around this issue. Otherwise users are going to blame us for it. It will cause extra mailing list messages and bug reports.

I don't have a good spot to test at the moment, but it feels like CMAKE_GENERATOR plus some detection of the current shell might do. That said, not seeeing any output from message("CXX: ${CXX}") makes me wonder what it's off doing when it hangs.

remarks

the CMAKE_CXX_COMPILER and CXX env variable

Looking at the example of CMakeLists.txt, displaying the variable CMAKE_CXX_COMPILER will be more informative. CXX will only be set as an environment variable it it was explicitly set as such.

Instead, you could do the following:

message("CMAKE_CXX_COMPILER:${CMAKE_CXX_COMPILER}")
message("Env. variable CXX:$ENV{CXX}")

minimum required version

Note also that CMake version 2.9 was a development release and is not available for download, I suggest to use cmake_minimum_required (VERSION 2.8) or cmake_minimum_required (VERSION 3.0). And ideally a newer version.

MinGW Makefiles vs MSYS Makefiles generator

When using MSYS (the successor of MinGW environment), the corresponding generator must be used: MSYS Makefiles

experiments

I also did few tests from the MSYS2 terminal:

  • Using CMake 3.12 without specifying the generator:
$ /c/cmake-3.12.1/bin/cmake.exe ../test-msys
-- Building for: Visual Studio 14 2015
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_CXX_COMPILER: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Env. variable CXX:
-- Configuring done
-- Generating done
-- Build files have been written to: D:/T/test-msys-build
  • Using CMake 2.8.12.2 (after changing to cmake_minimum_required (VERSION 2.8))
$ /c/cmake-2.8.12.2/bin/cmake.exe ../test-msys
-- Building for: Visual Studio 12
-- The CXX compiler identification is MSVC 18.0.40629.0
-- Check for working CXX compiler using: Visual Studio 12
-- Check for working CXX compiler using: Visual Studio 12 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMAKE_CXX_COMPILER: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
Env. variable CXX:
-- Configuring done
-- Generating done
-- Build files have been written to: D:/T/test-msys-build
  • /c/cmake-3.12.1/bin/cmake.exe -G "MinGW Makefiles" ../test-msys
$ /c/cmake-3.12.1/bin/cmake.exe -G "MinGW Makefiles" ../test-msys
CMake Error at C:/cmake-3.12.1/share/cmake-3.12/Modules/CMakeMinGWFindMake.cmake                :12 (message):
  sh.exe was found in your PATH, here:

  C:/msys64/usr/bin/sh.exe

  For MinGW make to work correctly sh.exe must NOT be in your path.

  Run cmake from a shell that does not have sh.exe in your PATH.

  If you want to use a UNIX shell, then use MSYS Makefiles.

Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


CMake Error: CMake was unable to find a build program corresponding to "MinGW Ma                kefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a differe                nt build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Ma                kefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a differe                nt build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
  • /c/cmake-3.12.1/bin/cmake.exe -G "MSYS Makefiles" ../test-msys

    • Make sure you start with MSYS2 MingGW 64-bit or MSYS2 MingGW 32-bit
    • Make sure you run pacman -Syu, then pacman -S gcc make to update associated packages and have a compiler available and make program available
$ /c/cmake-3.12.1/bin/cmake.exe -G "MSYS Makefiles" ../test-msys
$ /c/cmake-3.12.1/bin/cmake.exe -G "MSYS Makefiles" ../test-msys
-- The CXX compiler identification is GNU 7.3.0
-- Check for working CXX compiler: C:/msys64/usr/bin/g++.exe
-- Check for working CXX compiler: C:/msys64/usr/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_CXX_COMPILER: C:/msys64/usr/bin/g++.exe
Env. variable CXX:C:/msys64/usr/bin/g++.exe
-- Configuring done
-- Generating done
-- Build files have been written to: D:/T/test-msys-build

Note that CXX variable was already set. This is because the CMake generator takes care of setting it.

Problem solved by using MS Visual C++ Express!! ;-)