Skip to content

Commit fe59250

Browse files
committed
remove march=native option that does not work on Apple M1
1 parent 14cabd0 commit fe59250

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
@@ -82,6 +83,8 @@ class BuildExt(build_ext):
8283
}
8384

8485
if sys.platform == 'darwin':
86+
if platform.machine() == 'arm64':
87+
c_opts['unix'].remove('-march=native')
8588
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
8689
link_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
8790
else:

0 commit comments

Comments
 (0)