numpy has a C source file in their distutils checks, which is supposed to check for AVX512FP16, but for apparently historical reasons, it has: /* clang has a bug regarding our spr coode, see gh-23730. */ #if __clang__ #error #endif Since clang 19 now supports the -mavx512fp16 flag, other ports such as science/py-scipy (which depend on numpy) then bomb out in their configure scripts with: WARN: CCompilerOpt.dist_test[637] : CCompilerOpt._dist_test_spawn[771] : Command (cc -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -c /usr/local/lib/python3.11/site-packages/numpy/distutils/checks/cpu_avx512_spr.c -o /tmp/tmp_dkw8pp0/usr/local/lib/python3.11/site-packages/numpy/distutils/checks/cpu_avx512_spr.o -MMD -MF /tmp/tmp_dkw8pp0/usr/local/lib/python3.11/site-packages/numpy/distutils/checks/cpu_avx512_spr.o.d -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f -mno-mmx -mavx512cd -mavx512vl -mavx512bw -mavx512dq -mavx512vnni -mavx512ifma -mavx512vbmi -mavx512vbmi2 -mavx512bitalg -mavx512vpopcntdq -mavx512fp16 -Werror) failed with exit status 1 output -> /usr/local/lib/python3.11/site-packages/numpy/distutils/checks/cpu_avx512_spr.c:20:2: error: 20 | #error | ^ 1 error generated. I have tried clang 15 through 19 on cpu_avx512_spr.c with the #error removed, and none of them crashed or otherwise got an error. So I think we should simply remove the whole #if / #endif part. Also bump the portrevision, to force dependencies to configure against the new cpu_avx512_spr.c file.
Created attachment 252632 [details] math/py-numpy: remove clang error condition in distutils check
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=ba856133e5f1a18de13106955e417f998be213e5 commit ba856133e5f1a18de13106955e417f998be213e5 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-08-15 09:47:25 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2024-08-15 11:53:55 +0000 math/py-numpy: Remove clang error condition in distutils check - Bump PORTREVISION for package change PR: 280715 Tested by: dim (with Clang 15 to 19) math/py-numpy/Makefile | 2 +- math/py-numpy/files/patch-clang (new) | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
Committed. Thanks!