-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
59 lines (49 loc) · 2.03 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
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
from setuptools import setup
from Cython.Build import cythonize
import numpy as np
from os.path import join
metadata = {
'name': 'pypacmensl',
'version': '0.0.1',
'keywords': 'chemical master equation \ finite state projection \ parallel computing',
'license': 'BSD',
'author': 'Huy Vo',
'author_email': '[email protected]',
'maintainer': 'Huy Vo',
'maintainer_email': '[email protected]',
}
# %% Set MPI-wrapped compilers and extra C++ options
os.environ['CC'] = 'mpicc'
os.environ['CXX'] = 'mpic++'
extra_compile_args = ['-std=c++11', '-Wall', '-Wextra']
extra_links = []
# %%
pypacmensl_dirs = ['./src/pypacmensl']
#
pypacmensl_ext=[]
pypacmensl_subpackages=['callbacks', 'arma', 'fsp_solver', 'sensitivity', 'smfish', 'state_set',
# 'stationary',
'utils', 'ssa']
for folder in pypacmensl_subpackages:
extensions = cythonize('src/pypacmensl/'+ folder + '/*.pyx', language_level=3, include_path=pypacmensl_dirs)
for ext in extensions:
ext.language = "c++"
ext.libraries = ['pacmensl', 'petsc']
ext.extra_compile_args = extra_compile_args
ext.include_dirs = [os.environ['PETSC_DIR'] + '/include', np.get_include()]
ext.library_dirs = [join(os.environ['PETSC_DIR'], 'lib'), join(np.get_include(), '..', '..', 'random', 'lib')]
ext.extra_link_args=extra_links
pypacmensl_ext.extend(extensions)
# %%
setup(
packages=['pypacmensl', 'pypacmensl.fsp_solver', 'pypacmensl.state_set', 'pypacmensl.sensitivity',
'pypacmensl.stationary'],
package_dir={'pypacmensl': 'src/pypacmensl',
'pypacmensl.fsp_solver': 'src/pypacmensl/fsp_solver',
'pypacmensl.state_set': 'src/pypacmensl/state_set',
'pypacmensl.sensitivity': 'src/pypacmensl/sensitivity',
},
ext_modules= pypacmensl_ext,
**metadata
)