Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/pkgs/numpy/spkg-install.in: Workaround for clang compiler bug a…
Browse files Browse the repository at this point in the history
…ffecting 'reciprocal' and incomplete numpy fix
  • Loading branch information
mkoeppe committed Sep 25, 2022
1 parent 81a5e8e commit 03fad7d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build/pkgs/numpy/spkg-install.in
Expand Up @@ -7,6 +7,14 @@ if [ `uname` = "Darwin" ]; then
unset ATLAS
unset BLAS
unset LAPACK
# https://trac.sagemath.org/ticket/34110#comment:35
# The fix for "reciprocal" (affected by a clang compiler bug) in
# https://github.com/numpy/numpy/pull/19926 relies on -ftrapping-math
# being used when Apple clang v12+ is used.
# But numpy.distutils.ccompiler only sets this flag when
# $CC contains the string "clang" -- missing the case CC=/usr/bin/gcc.
# So we set it here explicitly if the compiler supports the flag.
export CFLAGS="$(testcflags.sh $CFLAGS -ftrapping-math)"
else
export {ATLAS,PTATLAS,OPENBLAS,MKL,MKLROOT}=None
export LDFLAGS="${LDFLAGS} -shared"
Expand Down

0 comments on commit 03fad7d

Please sign in to comment.