-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
45 lines (37 loc) · 1.31 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
import json, os
#import numpy as np
from setuptools import setup, Extension
if __name__ == '__main__':
"""
The first part compiles the broad package, the necessary
information is given in the setup.json file.
The second part compiles the files in the package written in Cython.
As of now this is the cov.pyx file in the _helpers directory. Quite
possibly you will need to change the c_flags.
"""
with open('setup.json', 'r') as info:
kwargs = json.load(info)
'''
# assuming gcc, set (aggressive) optimization flags,
# to be appended to the default compile line
c_flags = []
c_flags.append("-O3")
c_flags.append("-ffast-math")
c_flags.append("-fopenmp")
c_flags.append("-march=native")
c_flags.append("-fPIC")
c_flags.append("-fopt-info")
# extra link flags are possible as well;
#here we use the same as for compilation to link to libgomp
ld_flags = c_flags
ext1 = Extension("adsorptionanalyzer._helpers.get_distances",
sources=["adsorptionanalyzer/_helpers/get_distances.pyx"],
extra_compile_args=c_flags,
extra_link_args=ld_flags,
include_dirs=[np.get_include()]
)
'''
setup(
**kwargs,
#ext_modules=[ext1, ext2]
)