-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
executable file
·90 lines (80 loc) · 2.24 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
#!/usr/bin/env python3
import os
from Cython.Build import cythonize
from setuptools import Extension, setup
def get_include_dirs():
"""
Returns a list of all of the alternative include directories (virtual env,
conda env, etc.)
"""
return [
os.path.join(os.environ.get(_), "include/")
for _ in ["VIRTUAL_ENV", "CONDA_PREFIX"]
if os.environ.get(_)
]
def get_library_dirs():
"""
Returns a list of all of the alternative library directories (virtual env,
conda env, etc.)
"""
return [
os.path.join(os.environ.get(_), "lib/")
for _ in ["VIRTUAL_ENV", "CONDA_PREFIX"]
if os.environ.get(_)
]
extra_compile_args = [
"-fopenmp",
"-Ofast",
"-DHAVE_CLASS",
"-DHAVE_CUBA",
"-DCOFFE_CYTHON",
]
setup(
name="coffe",
version="3.0.0",
url="https://github.com/JCGoran/coffe",
author="Goran Jelic-Cizmek",
author_email="[email protected]",
packages=["coffe"],
ext_modules=cythonize(
[
Extension(
"coffe.coffe",
sources=[
"coffe/*.pyx",
"src/errors.c",
"src/common.c",
"src/parser.c",
"src/background.c",
"src/twofast.c",
"src/integrals.c",
"src/signal.c",
"src/functions.c",
"src/corrfunc.c",
"src/multipoles.c",
"src/utils.c",
"src/twobessel.c",
"src/covariance.c",
"src/average_multipoles.c",
"src/tanhsinh.c",
],
include_dirs=[
"src/",
"./",
]
+ get_include_dirs(),
libraries=[
"m",
"gsl",
"gslcblas",
"fftw3",
"cuba",
"class",
],
library_dirs=get_library_dirs(),
extra_compile_args=extra_compile_args,
extra_link_args=["-fopenmp"],
),
]
),
)