summaryrefslogtreecommitdiff
path: root/numpy/distutils/ccompiler.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-07-14 16:53:34 -0500
committerSebastian Berg <sebastian@sipsolutions.net>2021-07-14 20:56:42 -0500
commite7d18411dfc6a74ebb59fb3d57f524bbd6e993e2 (patch)
tree6194d9f5eba6a2ea2e17cfde291f135c54163eb0 /numpy/distutils/ccompiler.py
parentf3533711c854d05e2d767e3e8373c882d4d9f3ae (diff)
downloadnumpy-e7d18411dfc6a74ebb59fb3d57f524bbd6e993e2.tar.gz
BLD: Use `-ftrapping-math` for clang and for `_so`
Apparently, there is a second `compiler_so` that is actually the main compiler being used, and modifying only the first one is just futile. The old try was `-ffp-exception-behavior=strict`, but that seems to be a fairly new addition (and doesn't even work on MacOS with 10.0) `-ftrapping-math` seems to be the older, equivalent option.
Diffstat (limited to 'numpy/distutils/ccompiler.py')
-rw-r--r--numpy/distutils/ccompiler.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py
index 061f4862d..6d063ee4e 100644
--- a/numpy/distutils/ccompiler.py
+++ b/numpy/distutils/ccompiler.py
@@ -388,7 +388,8 @@ def CCompiler_customize_cmd(self, cmd, ignore=()):
if hasattr(self, 'compiler') and 'clang' in self.compiler[0]:
# clang defaults to a non-strict floating error point model.
# Since NumPy and most Python libs give warnings for these, override:
- self.compiler.append('-ffp-exception-behavior=strict')
+ self.compiler.append('-ftrapping-math')
+ self.compiler_so.append('-ftrapping-math')
def allow(attr):
return getattr(cmd, attr, None) is not None and attr not in ignore