forked from dmlc/minerva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·47 lines (43 loc) · 1019 Bytes
/
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
#!/usr/bin/env python
from setuptools import setup, Extension
from Cython.Build import cythonize
import os
import numpy
# Hack to use specified compiler
os.environ['CC'] = 'g++'
os.environ['OPT'] = ''
def relative_path(to):
base = os.path.dirname(os.path.realpath(__file__))
return os.path.join(base, to)
extensions = [
Extension(
'libowl',
sources=['owl/owl/libowl.pyx', 'owl/owl/minerva_utils.cpp'],
language='c++',
include_dirs=[
'minerva',
numpy.get_include(),
'release/third_party/include',
],
extra_compile_args=[
'-std=c++11',
'-Wall',
'-O2',
'-g'
],
libraries=[
'minerva'
],
library_dirs=[
'release/lib'
],
runtime_library_dirs=map(relative_path, [
'release/lib'
]),
)
]
setup(
name='owl',
package_dir={'': 'owl/owl'},
ext_modules=cythonize(extensions)
)