forked from frannerin/AlloViz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
129 lines (83 loc) · 3.77 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import os, sys, numpy
from setuptools import setup, Extension
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if not on_rtd:
# Necessary to create the version.py file for mdentropy to be able to use the original repo directly as a submodule
# from .Packages.mdentropy.basesetup import write_version_py
sys.path.append(".")
from src.Packages.mdentropy.basesetup import write_version_py
sys.path.append("./src/Packages/mdentropy")
from src.Packages.mdentropy.setup import VERSION, ISRELEASED
write_version_py(VERSION, ISRELEASED, 'src/Packages/mdentropy/mdentropy/version.py')
libinteract = \
Extension("libinteract.innerloops",
["src/Packages/pyinteraph2/libinteract/innerloops.pyx",
"src/Packages/pyinteraph2/libinteract/clibinteract.c"], \
include_dirs = [numpy.get_include(), "src/Packages/pyinteraph2/libinteract"])
from distutils.sysconfig import get_python_lib
mdtrajdir = get_python_lib() + "/mdtraj/core/lib"
mdtraj_capi = {'include_dir': mdtrajdir, 'lib_dir': mdtrajdir}
libdistance = \
Extension('msmbuilder.libdistance',
language='c++',
sources=['src/Packages/msmbuilder/msmbuilder/libdistance/libdistance.pyx'],
# msvc needs to be told "libtheobald", gcc wants just "theobald"
libraries=['theobald'],#'%stheobald' % ('lib' if compiler.msvc else '')],
include_dirs=["src/Packages/msmbuilder/msmbuilder/libdistance/src",
mdtraj_capi['include_dir'], numpy.get_include()],
library_dirs=[mdtraj_capi['lib_dir']],
)
# import platform
# import distutils.ccompiler
# # this code checks for OS. If OS is OSx then it checks for GCC as default compiler
# #if GCC is the default compiler adds -fopenmp to linker and compiler args.
# if 'darwin' in platform.system().lower():
# if 'gcc' in distutils.ccompiler.get_default_compiler():
# use_openmp = True
# else:
# use_openmp = False
# else:
# use_openmp = True
# extra_compile_args = ['-Wno-unreachable-code']
# extra_link_args = []
# if use_openmp:
# extra_compile_args += ['-fopenmp']
# extra_link_args = ['-fopenmp']
enspara_extensions = [
Extension(
"enspara.info_theory.libinfo",
["src/Packages/enspara/enspara/info_theory/libinfo.pyx"],
#extra_compile_args=extra_compile_args,
#extra_link_args=extra_link_args,
include_dirs=[numpy.get_include()],
), Extension(
"enspara.geometry.libdist",
["src/Packages/enspara/enspara/geometry/libdist.pyx"],
#extra_compile_args=extra_compile_args,
#extra_link_args=extra_link_args,
include_dirs=[numpy.get_include()],
), Extension(
"enspara.msm.libmsm",
["src/Packages/enspara/enspara/msm/libmsm.pyx"],
#extra_compile_args=extra_compile_args,
#extra_link_args=extra_link_args,
include_dirs=[numpy.get_include()],
)]
#from Cython.Build import cythonize
ext_modules = [libinteract, libdistance] + enspara_extensions #cythonize()
else:
# from src.AlloViz.AlloViz import info
# df = info.df
# df.index = pandas.MultiIndex.from_tuples(list(df.index), names=["Residue information extracted from trajectories",
# "Package",
# "Correlation measurement",
# "Atom/angle tracked"])
# with open("docs/source/table.html", "w") as f:
# f.writelines(
# df.to_html(buf=, header=False).replace(' valign="top"', '')
# )
ext_modules = []
# Where the magic happens:
setup(
ext_modules = ext_modules
)