worm icon indicating copy to clipboard operation
worm copied to clipboard

[Error] get a ton of errors when compiling.

Open ThatOneDev-Code opened this issue 2 years ago • 2 comments

os: void linux nim ver: 1.6.0

problem:

when ever i run the nim build command, i get alot of errors and have no idea what they mean, ive tried to read them but it looks like nim is trying to find files that arent there?

error(sorry for the block of text) :

/usr/lib/gcc/x86_64-unknown-linux-gnu/12.2/include/avxintrin.h: In function 'fillUnsafeAvx_wm_780': /usr/lib/gcc/x86_64-unknown-linux-gnu/12.2/include/avxintrin.h:1326:1: error: inlining failed in call to 'always_inline' '_mm256_set1_epi32': target specific option mismatch 1326 | _mm256_set1_epi32 (int __A) | ^~~~~~~~~~~~~~~~~ /home/pugn/.cache/nim/worm_r/@mwm.nim.c:2452:20: note: called from here 2452 | colorVec = _mm256_set1_epi32(LOC5.dest); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-unknown-linux-gnu/12.2/include/avxintrin.h:921:1: error: inlining failed in call to 'always_inline' '_mm256_store_si256': target specific option mismatch 921 | _mm256_store_si256 (__m256i __P, __m256i __A) | ^~~~~~~~~~~~~~~~~~ /home/pugn/.cache/nim/worm_r/@mwm.nim.c:2463:33: note: called from here 2463 | _mm256_store_si256(((void) (p)), colorVec); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-unknown-linux-gnu/12.2/include/avxintrin.h:1326:1: error: inlining failed in call to 'always_inline' '_mm256_set1_epi32': target specific option mismatch 1326 | _mm256_set1_epi32 (int __A) | ^~~~~~~~~~~~~~~~~ /home/pugn/.cache/nim/worm_r/@mwm.nim.c:2452:20: note: called from here 2452 | colorVec = _mm256_set1_epi32(LOC5.dest); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated due to -fmax-errors=3. Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -O3 -fno-strict-aliasing -fno-ident -I/home/pugn/.choosenim/toolchains/nim-1.6.0/lib -I/home/pugn/worm/src -o /home/pugn/.cache/nim/worm_r/@mwm.nim.c.o /home/pugn/.cache/nim/worm_r/@mwm.nim.c' failed with exit code: 1

   Tip: 35 messages have been suppressed, use --verbose to show them.
 Error: Build failed for package: worm
    ... Execution failed with exit code 1
    ... Command: /home/pugn/.nimble/bin/nim c --colors:on --noNimblePath -d:release -d:NimblePkgVersion=0.2.5 --path:/home/pugn/.nimble/pkgs/x11-1.1 --path:/home/pugn/.nimble/pkgs/pixie-5.0.4 --path:/home/pugn/.nimble/pkgs/vmath-1.2.0 --path:/home/pugn/.nimble/pkgs/chroma-0.2.7 --path:/home/pugn/.nimble/pkgs/zippy-0.10.5 --path:/home/pugn/.nimble/pkgs/flatty-0.3.4 --path:/home/pugn/.nimble/pkgs/nimsimd-1.2.2 --path:/home/pugn/.nimble/pkgs/bumpy-1.1.1 --path:/home/pugn/.nimble/pkgs/vmath-1.2.0 --path:/home/pugn/.nimble/pkgs/regex-0.20.1 --path:/home/pugn/.nimble/pkgs/unicodedb-0.11.2 --hints:off -o:/home/pugn/worm/worm /home/pugn/worm/src/worm.nim

any help would be great! and thanks!

ThatOneDev-Code avatar Dec 27 '22 21:12 ThatOneDev-Code

sorry, but it seems like this is a nim issue, not a worm issue, and I don't really know how to solve it. maybe ask on the nim forums?

codic12 avatar Jan 02 '23 02:01 codic12

This is a SIMD issue. You can fix it by adding the following to nim.cfg

--passC: "-march=native -mtune=native -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mpclmul -mavx -mavx2"

I encountered this issue on NixOS. If you don't have SIMD support, you can compile worm with -d:pixieNoSimd and it should compile.

xTrayambak avatar Mar 30 '24 14:03 xTrayambak