cm256 icon indicating copy to clipboard operation
cm256 copied to clipboard

Failing to build on ubuntu: error: inlining failed in call to always_inline

Open bakwc opened this issue 2 years ago • 6 comments

fippo@ubuntu:~$ uname -a
Linux ubuntu 5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
fippo@mainserver:~/cm_debug/build$ make
Scanning dependencies of target cm_debug
[ 20%] Building CXX object CMakeFiles/cm_debug.dir/main.cpp.o
[ 40%] Building CXX object CMakeFiles/cm_debug.dir/cm256.cpp.o
[ 60%] Building CXX object CMakeFiles/cm_debug.dir/gf256.cpp.o
In file included from /home/fippo/cm_debug/gf256.h:75:0,
                 from /home/fippo/cm_debug/gf256.cpp:30:
/usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h: In function ‘void gf256_mul_mem(void*, const void*, uint8_t, int)’:
/usr/lib/gcc/x86_64-linux-gnu/5/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)
 ^
/home/fippo/cm_debug/gf256.cpp:1197:50: error: called from here
             h0 = _mm_shuffle_epi8(table_hi_y, h0);
                                                  ^
In file included from /home/fippo/cm_debug/gf256.h:75:0,
                 from /home/fippo/cm_debug/gf256.cpp:30:
/usr/lib/gcc/x86_64-linux-gnu/5/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)
 ^
/home/fippo/cm_debug/gf256.cpp:1196:50: error: called from here
             l0 = _mm_shuffle_epi8(table_lo_y, l0);
                                                  ^
In file included from /home/fippo/cm_debug/gf256.h:75:0,
                 from /home/fippo/cm_debug/gf256.cpp:30:
/usr/lib/gcc/x86_64-linux-gnu/5/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)
 ^
/home/fippo/cm_debug/gf256.cpp:1197:50: error: called from here
             h0 = _mm_shuffle_epi8(table_hi_y, h0);
                                                  ^
In file included from /home/fippo/cm_debug/gf256.h:75:0,
                 from /home/fippo/cm_debug/gf256.cpp:30:
/usr/lib/gcc/x86_64-linux-gnu/5/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)
 ^
/home/fippo/cm_debug/gf256.cpp:1196:50: error: called from here
             l0 = _mm_shuffle_epi8(table_lo_y, l0);
                                                  ^
CMakeFiles/cm_debug.dir/build.make:110: recipe for target 'CMakeFiles/cm_debug.dir/gf256.cpp.o' failed
make[2]: *** [CMakeFiles/cm_debug.dir/gf256.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/cm_debug.dir/all' failed
make[1]: *** [CMakeFiles/cm_debug.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I suggest to add travis.ci or any other CI system to check builds.

bakwc avatar Aug 05 '21 19:08 bakwc

Were you able to resolve the problem or are you still stumped?

catid avatar Aug 10 '21 02:08 catid

It builds for me on an Ubuntu Intel box so not sure why it's failing for you..

catid avatar Aug 10 '21 03:08 catid

Possibly you're running it on an Intel PC that doesn't have SSSE3 instructions?

catid avatar Aug 10 '21 03:08 catid

I used another machine where it works fine. It still fails on my first machine.

fippo@mainserver:~/koding/cm256/build$ cat /proc/cpuinfo
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 6
model name	: AMD Turion(tm) II Neo N54L Dual-Core Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 800.000
cache size	: 1024 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
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 mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs		: tlb_mmatch apic_c1e fxsave_leak sysret_ss_attrs spectre_v1 spectre_v2
bogomips	: 4392.52
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 6
model name	: AMD Turion(tm) II Neo N54L Dual-Core Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 800.000
cache size	: 1024 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
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 mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs		: tlb_mmatch apic_c1e fxsave_leak sysret_ss_attrs spectre_v1 spectre_v2
bogomips	: 4392.52
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

Possibly you're running it on an Intel PC that doesn't have SSSE3 instructions?

AMD without SSSE3

bakwc avatar Aug 10 '21 09:08 bakwc

Ah okay. I think the issue is that the build flags need to be set to include SSSE3 with -m argument, and we should do runtime detection of the feature. But I'm lazy!

catid avatar Aug 12 '21 07:08 catid

The code already does runtime detection of feature would just need to update the CMakeLists.txt somehow

catid avatar Aug 12 '21 07:08 catid