-
Notifications
You must be signed in to change notification settings - Fork 4
/
cython_AVX.pyxbld
27 lines (21 loc) · 1010 Bytes
/
cython_AVX.pyxbld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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',
'-Ofast',
'-march=native',
'-fopenmp',
'-ffast-math',
'-std=gnu99',
'-I{}'.format(np.get_include()),
'-I{}'.format(os.path.dirname(os.path.abspath(__file__)))],
extra_link_args=extra_link_args)