Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Aug 2024 17:02:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        python@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 280715] math/py-numpy: remove clang error condition in distutils check
Message-ID:  <bug-280715-21822-LF4Xol56xo@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-280715-21822@https.bugs.freebsd.org/bugzilla/>
References:  <bug-280715-21822@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@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=3D280715



--- 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_s=
pr.c
-o
/tmp/tmp_dkw8pp0/usr/local/lib/python3.11/site-packages/numpy/distutils/che=
cks/
cpu_avx512_spr.o
-MMD -MF
/tmp/tmp_dkw8pp0/usr/local/lib/python3.11/site-packages/numpy/distutils/che=
cks/
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 ->
=20=20=20
/usr/local/lib/python3.11/site-packages/numpy/distutils/checks/cpu_avx512_s=
pr.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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-280715-21822-LF4Xol56xo>