-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
59 lines (51 loc) · 2.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
48
49
50
51
52
53
54
55
56
57
58
59
from distutils.core import setup
from distutils.core import setup, Extension
import numpy as np
import os
nonempty = lambda x: len(x) > 0
if os.getenv("C_INCLUDE_PATH") is not None:
sys_includes = filter(nonempty, os.getenv("C_INCLUDE_PATH").split(':'))
else:
sys_includes = []
if os.getenv("LIBRARY_PATH") is not None:
sys_libraries = filter(nonempty, os.getenv("LIBRARY_PATH").split(':'))
else:
sys_libraries = []
print sys_includes
print sys_libraries
#extra_compile_args = ['-g', '-pg', '-O0']
extra_compile_args = ['-O3']
# extra_compile_args += [ '--stdlib=libc++'] # uncomment this for OSX/clang
#extra_link_args = ['-Wl,--strip-all']
#extra_link_args = ['-lrt',]
extra_link_args = []
ctree_root = 'src_c'
ctree_sources = ['cover_tree_point.cc', 'cover_tree_pp_debug.cc', 'distances.cc', 'vector_mult_py.cc', 'quadratic_form_py.cc', 'compile_product_tree.cc']
from imp import find_module
f, pathname, descr = find_module("pyublas")
CTREE_INCLUDE_DIRS = [os.path.join(pathname, "include"),]
covertree_module = ctree = Extension('cover_tree',
sources=[os.path.join(ctree_root, s) for s in ctree_sources],
include_dirs=CTREE_INCLUDE_DIRS,
library_dirs=['/'],
#library_dirs=['/home/dmoore/.virtualenvs/sigvisa-dbg/lib/', '/'],
libraries=['boost_python'],
extra_compile_args=extra_compile_args,
extra_link_args = extra_link_args,
)
setup(
name='treegp',
version='0.1.0',
author='Dave Moore',
author_email='[email protected]',
packages=['treegp'],
url='https://github.com/davmre/treegp',
license='LICENSE',
description='Gaussian Process Regression toolkit for Python/Numpy',
long_description=open('README').read(),
install_requires=[
"numpy >= 1.1.0",
],
include_dirs=[np.get_include()] + sys_includes,
ext_modules=[covertree_module,]
)