veg / hyphy

HyPhy: Hypothesis testing using Phylogenies
http://www.hyphy.org
Other
205 stars 69 forks source link

Compile error #1564

Closed ArtPoon closed 1 year ago

ArtPoon commented 1 year ago

With latest version, ran cmake . and make MP:

[ 45%] Building CXX object CMakeFiles/hyphy.dir/src/core/matrix_mult.cpp.o
/home/apoon42/git/hyphy/src/core/matrix_mult.cpp: In function ‘void _hy_matrix_multiply_4x4x2(double*, double*, double*, int, bool)’:
/home/apoon42/git/hyphy/src/core/matrix_mult.cpp:2624:10: error: ‘_mm256_loadu2_m128d’ was not declared in this scope; did you mean ‘_mm256_loadu_si256’?
 2624 |     B1 = _mm256_loadu2_m128d  (B,B);      // 00,01 x 2
      |          ^~~~~~~~~~~~~~~~~~~
      |          _mm256_loadu_si256
make[3]: *** [CMakeFiles/hyphy.dir/build.make:479: CMakeFiles/hyphy.dir/src/core/matrix_mult.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:113: CMakeFiles/hyphy.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:363: CMakeFiles/MP.dir/rule] Error 2
make: *** [Makefile:305: MP] Error 2

Searching the repo, I determined that this file was a new addition and rolled back my local repo to tag 2.5.43. Build was clean with no errors.

OS: Ubuntu 20.04.5 LTS (5.4.0-136-generic)

spond commented 1 year ago

Dear @ArtPoon,

Thanks for reporting. Could you let me know what compiler/version generates this error? GCC (until version 10.x) was missing support for some x64x86 AVX2 intrinsics (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91341). I'll include a workaround (use other instructions) in the next release. clang has better support and so do later GCC versions.

Best, Sergei

ArtPoon commented 1 year ago

Looks like my system is using an older version of GCC:

apoon42@compute:~/git/hyphy$ cmake .
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
apoon42@compute:~/lab4$ /usr/bin/cc --version
cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
spond commented 1 year ago

Dear @ArtPoon,

In version 2.5.47, I'll be changing the cmake file to check for the presence of these AVX2 intrinsics. If you have an older gcc, these checks will now fail, and the code should compile by falling back onto the SSE4 option.

Best, Sergei

ArtPoon commented 1 year ago

Superb, thanks so much @spond !