-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
83 lines (79 loc) · 2.41 KB
/
Copy pathsetup.py
File metadata and controls
83 lines (79 loc) · 2.41 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
common_compile_args = ["-std=c++17"]
common_link_args = ["-lmongocxx", "-lbsoncxx", "-lpthread"]
common_include_dirs = [
"/usr/local/include/mongocxx/v_noabi",
"/usr/local/include/bsoncxx/v_noabi",
"./parallel_hashmap"
]
cython_dirs = "cython"
shared_cpp_sources = ["cpp/MongoManager.cpp", "cpp/Trie.cpp", "cpp/TrieNode.cpp"]
ext_modules = [
Extension(
name="Route",
sources=[f"{cython_dirs}/Route.pyx"],
extra_compile_args=common_compile_args,
language="c++",
),
Extension(
name="RouteTable",
sources=[f"{cython_dirs}/RouteTable.pyx"] + shared_cpp_sources,
include_dirs=common_include_dirs,
extra_compile_args=common_compile_args,
extra_link_args=common_link_args,
language="c++",
),
Extension(
name="Extension",
sources=[f"{cython_dirs}/Extension.pyx"],
extra_compile_args=common_compile_args,
language="c++",
),
Extension(
name="Message",
sources=[f"{cython_dirs}/Message.pyx"],
extra_compile_args=common_compile_args,
language="c++",
),
Extension(
name="AS",
sources=[f"{cython_dirs}/AS.pyx"] + shared_cpp_sources,
include_dirs=common_include_dirs,
extra_compile_args=common_compile_args,
extra_link_args=common_link_args,
language="c++",
),
Extension(
name="Topology",
sources=[f"{cython_dirs}/Topology.pyx"] + shared_cpp_sources,
include_dirs=common_include_dirs,
extra_compile_args=common_compile_args,
extra_link_args=common_link_args,
language="c++",
),
Extension(
name="Processor",
sources=[f"{cython_dirs}/Processor.pyx"] + shared_cpp_sources,
include_dirs=common_include_dirs,
extra_compile_args=common_compile_args,
extra_link_args=common_link_args,
language="c++",
),
Extension(
name="Scheduler",
sources=[f"{cython_dirs}/Scheduler.pyx"] + shared_cpp_sources,
include_dirs=common_include_dirs,
extra_compile_args=common_compile_args,
extra_link_args=common_link_args,
language="c++",
),
]
setup(
ext_modules=cythonize(
ext_modules,
),
cmdclass={"build_ext": build_ext},
)