Skip to content

Commit

Permalink
Drop -march/mtune=native on OSX, it seems to interfere with Rosetta
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsta committed Feb 23, 2024
1 parent fa1dca7 commit 28535c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@
#with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
# long_description = f.read()

native_ok = not ('darwin' in platform.system().lower())

def get_cflags():
if 'windows' in platform.system().lower():
# Assuming MSVC, probably Anaconda
return ["/O2", "/std:c++17"]
if use_asan:
return '-O0 -g -DISOSPEC_DEBUG -std=c++17 -fsanitize=address'.split()
return '-mtune=native -march=native -O3 -std=c++17'.split()
ret = ['-O3', '-std=c++17']
if native_ok:
ret.extend(['-mtune=native', '-march=native'])
return ret

cmodule = Extension('IsoSpecCppPy',
sources = ['IsoSpec++/python-build.cpp'],
Expand Down

0 comments on commit 28535c4

Please sign in to comment.