-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
71 lines (57 loc) · 1.98 KB
/
setup.py
File metadata and controls
71 lines (57 loc) · 1.98 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
import os
import sys
from numpy import get_include as get_numpy_include
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
def get_pybind_include():
pybind_inc = os.path.join(os.path.dirname(__file__), 'pybind11', 'include')
assert os.path.exists(pybind_inc)
return pybind_inc
def get_spdlog_include():
inc = os.path.join(os.path.dirname(__file__), 'spdlog', 'include')
assert os.path.exists(inc)
return inc
def get_project_include():
inc = os.path.join(os.path.dirname(__file__), 'cpp', 'include')
assert os.path.exists(inc)
return inc
ext_modules = [
Extension(
'readdy_learn.analyze_tools',
sources=['cpp/src/main.cpp', 'cpp/src/lasso_minimizer_objective_fun.cpp'],
language='c++',
include_dirs=[
get_pybind_include(), get_spdlog_include(), get_project_include(), get_numpy_include()
],
extra_compile_args=['-std=c++14', '-O3', '-fvisibility=hidden']
),
]
class BuildExt(build_ext):
"""A custom build extension for adding compiler-specific options."""
c_opts = {
'unix': [],
}
if sys.platform == 'darwin':
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
def build_extensions(self):
ct = self.compiler.compiler_type
opts = self.c_opts.get(ct, [])
opts.append('-fvisibility=hidden')
opts.append('-std=c++14')
opts.append('-O3')
for ext in self.extensions:
ext.extra_compile_args = opts
build_ext.build_extensions(self)
setup(
name='readdy_learn',
version='0.0.1',
author='ReaDDy team',
author_email='clonker@gmail.com',
url='https://github.com/readdy/readdy_learn',
description='readdy learn',
long_description='some more description',
ext_modules=ext_modules,
packages=find_packages(),
zip_safe=False,
install_requires=['numpy', 'scipy', 'pathos', 'scikit-learn', 'h5py', 'matplotlib']
)