Skip to content

Commit 8a32e35

Browse files
committed
BLD: remove -ftrapping-math on macosx_arm64
1 parent c9229a3 commit 8a32e35

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

numpy/distutils/ccompiler.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import re
33
import sys
4+
import platform
45
import shlex
56
import time
67
import subprocess
@@ -394,8 +395,14 @@ def CCompiler_customize_cmd(self, cmd, ignore=()):
394395
log.info('customize %s using %s' % (self.__class__.__name__,
395396
cmd.__class__.__name__))
396397

397-
if hasattr(self, 'compiler') and 'clang' in self.compiler[0]:
398+
if (
399+
hasattr(self, 'compiler') and
400+
'clang' in self.compiler[0] and
401+
not (platform.machine() == 'arm64' and sys.platform == 'darwin')
402+
):
398403
# clang defaults to a non-strict floating error point model.
404+
# However, '-ftrapping-math' is not currently supported (2022-04-08)
405+
# for macosx_arm64.
399406
# Since NumPy and most Python libs give warnings for these, override:
400407
self.compiler.append('-ftrapping-math')
401408
self.compiler_so.append('-ftrapping-math')

0 commit comments

Comments
 (0)