Skip to content
Snippets Groups Projects
Commit 3d00d87f authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'macos' into 'master'

fix compiler options for macOS

See merge request pycodegen/pystencils!12
parents d19180a9 0142fe24
Branches
Tags
No related merge requests found
...@@ -154,7 +154,7 @@ def read_config(): ...@@ -154,7 +154,7 @@ def read_config():
default_compiler_config = OrderedDict([ default_compiler_config = OrderedDict([
('os', 'darwin'), ('os', 'darwin'),
('command', 'clang++'), ('command', 'clang++'),
('flags', '-Ofast -DNDEBUG -fPIC -march=native -fopenmp -std=c++11'), ('flags', '-Ofast -DNDEBUG -fPIC -march=native -Xclang -fopenmp -std=c++11'),
('restrict_qualifier', '__restrict__') ('restrict_qualifier', '__restrict__')
]) ])
default_cache_config = OrderedDict([ default_cache_config = OrderedDict([
...@@ -518,6 +518,11 @@ def compile_module(code, code_hash, base_dir): ...@@ -518,6 +518,11 @@ def compile_module(code, code_hash, base_dir):
py_lib = os.path.join(config_vars["installed_base"], "libs", py_lib = os.path.join(config_vars["installed_base"], "libs",
"python{}.lib".format(config_vars["py_version_nodot"])) "python{}.lib".format(config_vars["py_version_nodot"]))
run_compile_step(['link.exe', py_lib, '/DLL', '/out:' + lib_file, object_file]) run_compile_step(['link.exe', py_lib, '/DLL', '/out:' + lib_file, object_file])
elif platform.system().lower() == 'darwin':
with atomic_file_write(lib_file) as file_name:
run_compile_step([compiler_config['command'], '-shared', object_file, '-o', file_name, '-undefined',
'dynamic_lookup']
+ compiler_config['flags'].split())
else: else:
with atomic_file_write(lib_file) as file_name: with atomic_file_write(lib_file) as file_name:
run_compile_step([compiler_config['command'], '-shared', object_file, '-o', file_name] run_compile_step([compiler_config['command'], '-shared', object_file, '-o', file_name]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment