Inlining failed to always call always_inline '_mm_mullo_epi32: target option mismatch

I am trying to compile a C program using cmake, which uses the built-in SIMD functions. When I try to compile it, I get two errors

/ usr / lib / gcc / x86_64-linux-gnu / 5 / include / smmintrin.h : 326: 1: error: attachment failed when invoking always_inline '_mm_mullo_epi32: target parameter mismatch _mm_mullo_epi32 (__m128i __X, __m128i __m128i __m128i __m128i __m128i

/ usr / lib / gcc / x86_64-linux-gnu / 5 / include / tmmintrin.h : 136: 1: error: attachment failed when invoking always_inline '_mm_shuffle_epi8: mismatch of target parameter _mm_shuffle_epi8 (__m128i __X, __m128i __m128i __m128i __m128i __m128i

This problem has been solved here qaru.site/questions/1673651 / ... , setting

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")

I try the same thing and many other options. But my project is still not compiling.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")  
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -sse4_1")  
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=nehalem")  
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1 -msse4.2")  
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")  
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ssse3")  
+4
source share
1 answer

Since you are compiling C code, not C ++, you need to:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1")

You can get rid of all other settings -march XXXand -msseXXX.

If you use a combination of C and C ++, you can also add:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
+3
source

Source: https://habr.com/ru/post/1673649/


All Articles