ParBLiSS / PaSGAL

Parallel Sequence to Graph Alignment
MIT License
35 stars 4 forks source link

failure to inline avx intrinsic #1

Closed ekg closed 5 years ago

ekg commented 5 years ago

I'm compiling on a system that has AVX, with gcc version 7.4.0-1ubuntu1~18.04.

I ran into this error:

[ 29%] Building CXX object CMakeFiles/PaSGAL.dir/src/main.cpp.o
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:45:0,
                 from /home/erik/PaSGAL/src/include/base_types.hpp:10,
                 from /home/erik/PaSGAL/src/include/parseCmdArgs.hpp:10,
                 from /home/erik/PaSGAL/src/main.cpp:12:
/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h: In static member function ‘static __mxxxi psgl::SimdInst<int>::add(const __mxxxi&, const __mxxxi&)’:
/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h:818:1: error: inlining failed in call to always_inline ‘__m512i _mm512_add_epi32(__m512i, __m512i)’: target specific option mismatch
 _mm512_add_epi32 (__m512i __A, __m512i __B)
 ^~~~~~~~~~~~~~~~
In file included from /home/erik/PaSGAL/src/include/align.hpp:20:0,
                 from /home/erik/PaSGAL/src/main.cpp:14:
/home/erik/PaSGAL/src/include/align_vectorized.hpp:48:95: note: called from here
       static inline __mxxxi add (const __mxxxi& a, const __mxxxi& b) { return _mm512_add_epi32(a, b); }
                                                                               ~~~~~~~~~~~~~~~~^~~~~~
CMakeFiles/PaSGAL.dir/build.make:62: recipe for target 'CMakeFiles/PaSGAL.dir/src/main.cpp.o' failed

Any suggestions about how to resolve it?

cjain7 commented 5 years ago

Check if the CPU you are using supports AVX512 or AVX2 or none... you'll need to compile accordingly (see the cmake option -DSIMD_SUPPORT in README).

Assuming you are using linux, flags in /proc/cpuinfo will tell you the available SIMD support.

ekg commented 5 years ago

It looks like I have only avx and avx2:

-> % lscpu | grep Flags | tr ' ' '\n' | grep avx 
avx
avx2

I'll try to set the flags accordingly.

ekg commented 5 years ago

Building with cmake -H. -Bbuild -DSIMD_SUPPORT=avx2 && cmake --build build -- -j 4 solves my problem!