-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·52 lines (47 loc) · 1.57 KB
/
setup.py
File metadata and controls
executable file
·52 lines (47 loc) · 1.57 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
44
45
46
47
48
49
50
51
52
from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np
import platform
import distutils.ccompiler
# this code checks for OS. If OS is OSx then it checks for GCC as default compiler
#if GCC is the default compiler adds -fopenmp to linker and compiler args.
use_openmp = (not 'darwin' in platform.system().lower()) or ('gcc' in distutils.ccompiler.get_default_compiler())
extra_compile_args = [ '-Wno-unreachable-code' ]
extra_link_args = []
define_macros = [
# Target numpy ABIs >=2.0
('NPY_NO_DEPRECATED_API', 'NPY_2_0_API_VERSION')
]
if use_openmp:
extra_compile_args += [ '-fopenmp' ]
extra_link_args += [ '-fopenmp' ]
ext_modules = cythonize(
[
Extension(
"enspara.info_theory.libinfo",
[ "enspara/info_theory/libinfo.pyx" ],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=define_macros,
),
Extension(
"enspara.geometry.libdist",
[ "enspara/geometry/libdist.pyx" ],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=define_macros,
),
Extension(
"enspara.msm.libmsm",
[ "enspara/msm/libmsm.pyx" ],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=define_macros,
)
],
compiler_directives={ "language_level" : "3" }
)
setup(
ext_modules=ext_modules,
include_dirs=[np.get_include()]
)