-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
55 lines (47 loc) · 1.36 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
import glob
import numpy as np
from setuptools import find_packages, setup
from setuptools.extension import Extension
from numpy.distutils.misc_util import get_info
npymath_info = get_info('npymath')
USE_CYTHON = True # os.environ.get("USE_CYTHON", True)
ext = ".pyx" if USE_CYTHON else ".cpp"
tskit_sourcefiles = ["tskit/c/subprojects/kastore/kastore.c"] + list(
glob.glob("tskit/c/tskit/*.c")
)
include_dirs = ["include", "tskit/c", "tskit/c/subprojects/kastore", np.get_include()]
npymath_info.setdefault('include_dirs', [])
npymath_info['include_dirs'] += include_dirs
extensions = [
Extension(
"xsmc._tskit",
["tskit/python/_tskitmodule.c"] + tskit_sourcefiles,
include_dirs=include_dirs,
),
Extension(
"xsmc._viterbi",
["xsmc/_viterbi.pyx"] + tskit_sourcefiles,
language="c++",
include_dirs=include_dirs,
),
Extension(
"xsmc._sampler",
["xsmc/_sampler.pyx"] + tskit_sourcefiles,
language="c++",
**npymath_info,
extra_compile_args=["-Wfatal-errors"]
),
]
setup(
name="xsmc",
author="Caleb Ki and Jonathan Terhorst",
author_email="[email protected]",
install_requires=[
"numpy>=1.17.0",
"scipy>=1.5.0",
"matplotlib>=3.0.0",
"tskit>=0.3.1",
],
packages=find_packages(),
ext_modules=extensions,
)