lh3 / miniprot

Align proteins to genomes with splicing and frameshift
https://lh3.github.io/miniprot/
MIT License
310 stars 16 forks source link

Compile error on AMD EPYC 7742 #48

Closed ftegenfe closed 11 months ago

ftegenfe commented 11 months ago

I see the following compile error on AMD EPYC 7742:

nasw-sse.c: In function ‘ns_select’: nasw-sse.c:256:16: warning: implicit declaration of function ‘_mm_blendv_epi8’; did you mean ‘_mm_adds_epi8’? [-Wimplicit-function-declaration] 256 | return _mm_blendv_epi8(b, a, cond);

I use gcc 12.1.1, Rocky Linux 9.1, kernel 5.14.0-162.23.1.el9_1.x86_64.

I did manage to make it compile by changing the order by which the SSE version is checked at the beginning of nasw-sse.c:

#if defined(__SSE4_1__)
#include <smmintrin.h>
#elif defined(__SSE2__)
#include <xmmintrin.h>
#elif defined(__ARM_NEON)
#include "s2n-lite.h"
#endif

In the original code SSE2 is checked first and on our system both SSE2 and SSE4_1 are defined leading to including the wrong file. With the above correction this is fixed.

lh3 commented 11 months ago

Yes, you are correct. Thanks a lot for the fix!