Skip to content

Commit

Permalink
fix: setup platform check on Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
iamDecode committed Apr 25, 2023
1 parent c1e6e47 commit 83519d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup.py
Expand Up @@ -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']
Expand Down

0 comments on commit 83519d9

Please sign in to comment.