nixpkgs/pkgs/by-name/ab/abpoa/simd-arch.patch

28 lines
1.1 KiB
Diff

diff --git a/setup.py b/setup.py
index 52c0e7e..f88ec08 100644
--- a/setup.py
+++ b/setup.py
@@ -11,11 +11,12 @@ simde = ['-DUSE_SIMDE', '-DSIMDE_ENABLE_NATIVE_ALIASES']
if platform.system() == "Darwin":
# note: see https://github.com/pypa/wheel/issues/406
- simd_flag = ['-march=native', '-D__AVX2__', '-mmacosx-version-min=10.9']
if platform.machine() in ["aarch64", "arm64"]:
+ simd_flag = ['-march=armv8-a+simd', '-D__AVX2__', '-mmacosx-version-min=10.9']
os.environ['_PYTHON_HOST_PLATFORM'] = "macosx-10.9-arm64"
os.environ['ARCHFLAGS'] = "-arch arm64"
else:
+ simd_flag = ['-msse2', '-mmacosx-version-min=10.9']
os.environ['_PYTHON_HOST_PLATFORM'] = "macosx-10.9-x86_64"
os.environ['ARCHFLAGS'] = "-arch x86_64"
else:
@@ -24,7 +25,7 @@ else:
elif platform.machine() in ["aarch32"]:
simd_flag = ['-march=armv8-a+simd', '-mfpu=auto -D__AVX2__']
else:
- simd_flag=['-march=native']
+ simd_flag=[]
if os.getenv('SSE4', False):
simd_flag=['-msse4.1']
elif os.getenv('SSE2', False):