-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
43 lines (39 loc) · 1.22 KB
/
Copy pathsetup.py
File metadata and controls
43 lines (39 loc) · 1.22 KB
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
33
34
35
36
37
38
39
40
41
42
43
from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np
import scipy
import os
scipy_include = os.path.dirname(scipy.__file__)
scipy_include = os.path.join(scipy_include, '..', 'scipy')
common_args = {
'include_dirs': [np.get_include(), scipy_include],
'libraries': ['blas'],
'extra_compile_args': [
"-O3", "-march=native", "-flto=16", "-fopenmp",
"-funroll-loops", "-ftree-vectorize", "-fprefetch-loop-arrays",
"-fno-math-errno", "-fno-semantic-interposition"
],
'extra_link_args': [
"-O3", "-march=native", "-flto=16", "-fopenmp", "-Wl,-O1", "-Wl,--as-needed"
],
'define_macros': [
('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION'),
('CYTHON_FAST_PYCCALL', '1'),
('CYTHON_USE_TYPE_SLOTS', '1'),
('CYTHON_USE_PYTYPE_LOOKUP', '1')
]
}
extensions = [
Extension("cy_src.tt_ops_cy", ["cy_src/tt_ops_cy.pyx"], **common_args),
Extension("cy_src.lgmres_cy", ["cy_src/lgmres_cy.pyx"], **common_args)
]
setup(
ext_modules=cythonize(
extensions,
force=True,
language_level=3
),
zip_safe=False,
script_args=["build_ext", "--inplace"],
install_requires=['numpy', 'scipy']
)