Closed ryandesign closed 4 months ago
Testing whether things work breaks cross-compiling. Although if "things work" just means can it link rather than does it run, then that's viable however in theory it's what it already does.
On my linux box I see this as a working test in config.log:
| int
| main ()
| {
|
| #ifdef __x86_64__
| __m512i a = _mm512_set1_epi32(1);
| __m512i b = _mm512_add_epi32(a, a);
| return _mm_popcnt_u32(*((char *) &b));
| #endif
|
| ;
| return 0;
| }
configure:12629: gcc -o conftest -Wall -g -O3 -mavx512f -mpopcnt conftest.c -lbz2 >&5
configure:12629: $? = 0
So that is compiling and linking a program using an avx512 instruction. Do you see the same thing in config.log when it fails? If so it's possible you have a partial AVX512 implementation and we need to test other functions instead. (You can see these if you search for _mm512_set1_epi32
in configure.ac). I don'thave a mac to test this on, and AWS MacOS instances don't go earlier than 12.x (Monterey).
If you can figure out how to get the test working on 10.11.6 (last release in July 2016) then I'll consider changes, but it's not something I'm going to be able to do myself due to neither hardware nor software available to me.
Building htslib 1.20 on OS X 10.11.6 with the version of clang included in Xcode 8.2.1 (
Apple LLVM version 8.0.0 (clang-800.0.42.1)
) configure says:and the build fails:
10.11 log
On OS X 10.12.6 with the version of clang included in Xcode 9.2 (
Apple LLVM version 9.0.0 (clang-900.0.39.2)
) configure says:and the build succeeds.
10.12 log
On OS X 10.10.5 with the version of clang included in Xcode 7.2.1 (
Apple LLVM version 7.0.2 (clang-700.1.81)
) configure says:and the build succeeds.
10.10 log
This makes me think that it might be possible to improve the configure test so that it can detect not only whether the compiler supports flags for avx512f but also whether they will work.