From 83519d935df94073dbb8a8f9b382583a2abd57c7 Mon Sep 17 00:00:00 2001 From: Dennis Collaris Date: Tue, 25 Apr 2023 22:03:23 +0200 Subject: [PATCH] fix: setup platform check on Apple Silicon --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 3db7820..39faf23 100644 --- a/setup.py +++ b/setup.py @@ -44,9 +44,9 @@ # Note that -O3 may sometimes cause mysterious problems, so we limit ourselves to -O2. # Modules involving numerical computations -if platform.system() == 'Darwin' and platform.machine() == 'aarch64' or 'universal2' in os.environ.get('CIBW_ARCHS', ''): # Apple Silicon - extra_compile_args_math_optimized = ['-O2'] - extra_compile_args_math_debug = ['-O0', '-g'] +if platform.system() == 'Darwin' and platform.machine() == 'aarch64' or 'universal2' or 'arm64' in os.environ.get('CIBW_ARCHS', ''): # Apple Silicon + extra_compile_args_math_optimized = ['-O2', '-march=native'] + extra_compile_args_math_debug = ['-O0', '-march=native', '-g'] else: extra_compile_args_math_optimized = ['-mtune=native', '-march=native', '-O2', '-msse', '-msse2', '-mfma', '-mfpmath=sse'] extra_compile_args_math_debug = ['-mtune=native', '-march=native', '-O0', '-g']