-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
47 lines (43 loc) · 1.24 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 sys
import shutil
from setuptools import setup, Command, Extension
sources = [
"cpp_src/lowIndex.cpp",
"cpp_src/words.cpp",
"cpp_src/coveringSubgraph.cpp",
"cpp_src/simsNode.cpp",
"cpp_src/stackedSimsNode.cpp",
"cpp_src/abstractSimsNode.cpp",
"cpp_src/simsTreeBase.cpp",
"cpp_src/simsTree.cpp",
"cpp_src/simsTreeMultiThreaded.cpp",
# The pybind11 headers are somewhat heavy - compiling all pieces
# of the python wrapping in the same translation unit speeds up
# compilation significantly.
"cpp_src/wrapAll.cpp"
]
if sys.platform.startswith('win'):
extra_compile_args = ['/Ox', '/std:c++14']
else:
extra_compile_args = ['-O3', '-std=c++11']
ext_modules = [
Extension(
name = 'low_index._low_index',
sources = sources,
extra_compile_args = extra_compile_args)
]
class Clean(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
for dir in ['build', 'dist', 'low_index.egg-info']:
shutil.rmtree(dir, ignore_errors=True)
setup(
packages = ['low_index'],
package_dir = {'low_index':'python_src'},
ext_modules=ext_modules,
cmdclass = {'clean':Clean}
)