-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsetup_profile.py
32 lines (28 loc) · 1.29 KB
/
setup_profile.py
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
26
27
28
29
30
31
32
from distutils.core import setup,Extension
import numpy
from Cython.Build import cythonize
from Cython.Compiler.Options import _directive_defaults
_directive_defaults['linetrace'] = True
_directive_defaults['binding'] = True
extensions = [Extension("factor_graph", ["graph_learning/cython/factor_graph.pyx"],include_dirs = [numpy.get_include()],
# libraries=["m"],
# extra_compile_args = ["-O3", "-ffast-math", "-march=native", ],
language='c',
define_macros=[('CYTHON_TRACE', '1')]
),
Extension("open_crf",['graph_learning/cython/open_crf.pyx'], include_dirs = [numpy.get_include()],
# extra_compile_args=["-fPIC", "-O3"],
# extra_link_args=["-fPIC", "-O3"],
# libraries=["m"],
# extra_compile_args = ["-O3", "-ffast-math", "-march=native", ],
language='c',
define_macros=[('CYTHON_TRACE', '1')]
),
]
setup(
name = 'open_crf cython',
package_data = {
'graph_learning/cython': ['*.pxd'],
},
ext_modules=cythonize(extensions,include_path=[numpy.get_include()],)
)