8000 BLD: Use `-ftrapping-math` for clang and for `_so` · numpy/numpy@e7d1841 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7d1841

Browse files
committed
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.
1 parent f353371 commit e7d1841

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

numpy/distutils/ccompiler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ def CCompiler_customize_cmd(self, cmd, ignore=()):
388388
if hasattr(self, 'compiler') and 'clang' in self.compiler[0]:
389389
# clang defaults to a non-strict floating error point model.
390390
# Since NumPy and most Python libs give warnings for these, override:
391-
self.compiler.append('-ffp-exception-behavior=strict')
391+
self.compiler.append('-ftrapping-math')
392+
self.compiler_so.append('-ftrapping-math')
392393

393394
def allow(attr):
394395
return getattr(cmd, attr, None) is not None and attr not in ignore

0 commit comments

Comments
 (0)
0