-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup.py
47 lines (39 loc) · 1.07 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
import os
import platform
import numpy
from setuptools import Extension
from setuptools import setup
IS_WINDOWS = platform.system() == "Windows"
libdir = "lib"
tskroot = os.path.join(libdir, "subprojects", "tskit")
tskdir = os.path.join(tskroot, "tskit")
kasdir = os.path.join(tskroot, "subprojects", "kastore")
includes = [libdir, tskroot, tskdir, kasdir]
tsi_source_files = [
"ancestor_matcher.c",
"ancestor_builder.c",
"object_heap.c",
"tree_sequence_builder.c",
"err.c",
"avl.c",
]
tsk_source_files = ["core.c"]
kas_source_files = ["kastore.c"]
sources = (
["_tsinfermodule.c"]
+ [os.path.join(libdir, f) for f in tsi_source_files]
+ [os.path.join(tskdir, f) for f in tsk_source_files]
+ [os.path.join(kasdir, f) for f in kas_source_files]
)
libraries = ["Advapi32"] if IS_WINDOWS else []
_tsinfer_module = Extension(
"_tsinfer",
sources=sources,
extra_compile_args=["-std=c99"],
libraries=libraries,
undef_macros=["NDEBUG"],
include_dirs=includes + [numpy.get_include()],
)
setup(
ext_modules=[_tsinfer_module],
)