Bugzilla Automation <bugzi...@freebsd.org> has asked freebsd-python (Nobody)
<python@FreeBSD.org> for maintainer-feedback:
Bug 280715: math/py-numpy: remove clang error condition in distutils check
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280715



--- Description ---
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.

Reply via email to