Skip to content

Commit ef7b239

Browse files
authored
Merge pull request #363 from yoshoku/darwin-arm64
Disable march=native option when building on Apple M1
2 parents 2ebbc2c + fe59250 commit ef7b239

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import sys
3+
import platform
34

45
import numpy as np
56
import pybind11
@@ -86,6 +87,8 @@ class BuildExt(build_ext):
8687
}
8788

8889
if sys.platform == 'darwin':
90+
if platform.machine() == 'arm64':
91+
c_opts['unix'].remove('-march=native')
8992
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
9093
link_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
9194
else:

0 commit comments

Comments
 (0)