1

I don't know why I got this message. How can I solve it?

g++ -c -o release/main.o main.cpp -Wall -fmessage-length=0 -march=native -O0
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:61:0,
                 from main.cpp:11:
/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512vldqintrin.h: In function ‘int main()’:
/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512vldqintrin.h:829:1: error: inlining failed in call to always_inline ‘__m128 _mm_cvtepi64_ps(__m128i)’: target specific option mismatch
 _mm_cvtepi64_ps (__m128i __A)
 ^~~~~~~~~~~~~~~
main.cpp:100:13: note: called from here
    rsPacket = _mm_cvtepi64_ps(tmp128iPacket1);   //__m128i -> __m128
    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lscpu

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              2
On-line CPU(s) list: 0,1
Thread(s) per core:  1
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               69
Model name:          Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz
Stepping:            1
CPU MHz:             2799.998
BogoMIPS:            5599.99
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            3072K
NUMA node0 CPU(s):   0,1
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase avx2 invpcid md_clear flush_l1d

I got always the same error, even if I change the function. I'm using; <immintrin.h>, <xmmintrin.h>, <emmintrin.h>. Also I saw that a possible solution is to add in file.pro: QMAKE_CXXFLAGS +=-msse3. But I don't know how to find it.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 6
    It looks like this intrinsic is supposed to generate an AVX512 instruction, which your CPU doesn't appear to support, and `-march=native` tells the compiler to restrict itself to features which the build machine's CPU does support. So it fails. How were you expecting this to work? – Nate Eldredge Dec 10 '20 at 05:51
  • I do kinda wish this error message was better worded; something like `error: intrinsic not supported by -march=native` would be a lot more understandable. – nneonneo Dec 10 '20 at 06:06
  • 3
    The hints are there: it's defined in `avx512vldqintrin.h` , and once you understand what `target specific option mismatch` means you'll be able to understand it next time. Keep in mind that GCC has a lot of ways to control what target ISA options are allowed, including `-mavx512f`, or in the source using `#pragma something` or `__attribute__((target("avx512vl")))` on a function, so it's non-trivial for an error-message printing function to know exactly why some ISA extensions are enabled and others aren't. (And getting it wrong would be worse than a generic message.) – Peter Cordes Dec 10 '20 at 13:47

0 Answers0