-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcython_omp.pyxbld
More file actions
21 lines (19 loc) · 850 Bytes
/
cython_omp.pyxbld
File metadata and controls
21 lines (19 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np
import platform
import os.path
extra_link_args = ['-fopenmp']
# work around problems on OSX with bad linkers
if platform.system() == 'Darwin':
if os.path.exists('/usr/local/lib/libiomp5.dylib'):
extra_link_args = ['-L/usr/local/lib', '-liomp5']
def make_ext(modname, pyxfilename):
from distutils.extension import Extension
return Extension(name=modname,
sources=[pyxfilename],
extra_compile_args=['-Wno-unused-function',
'-std=gnu99',
'-Ofast',
'-march=native',
'-fopenmp',
'-I{}'.format(np.get_include())],
extra_link_args=extra_link_args)