-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
46 lines (35 loc) · 1.21 KB
/
setup.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
import sys
try:
import multiprocessing
nthreads = multiprocessing.cpu_count()
except:
print("failed to import multiprocessing, building on one core")
nthreads = 0
define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
print("define macros", define_macros)
extensions = []
try:
import numpy as np
numpy_headers = [np.get_include()]
except:
print("could not import a library necessary for building cython extensions")
exit(1)
cpp_headers = ['./']
cpp_libs = []
include_dirs = numpy_headers + cpp_headers
extensions = cythonize([Extension("*", ["./*/*.pyx"],
include_dirs=include_dirs,
libraries=cpp_libs,
define_macros=define_macros,
)
],
nthreads=nthreads,
annotate=True,
compiler_directives={'language_level':'3'},
gdb_debug=True)
setup(
python_requires=">=3",
ext_modules=extensions,
)