-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
executable file
·81 lines (76 loc) · 3.44 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
import numpy
import os
from setuptools import setup
from distutils.extension import Extension
from setuptools.command.build_ext import build_ext as _build_ext
from Cython.Build import cythonize
if not("LAL_PREFIX" in os.environ):
print("No LAL installation found, please install LAL from source"
"or source your LAL installation")
exit()
else:
lal_prefix = os.environ.get("LAL_PREFIX")
# See https://stackoverflow.com/a/21621689/1862861
# for why this is here.
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
self.include_dirs.append(numpy.get_include())
lal_includes = lal_prefix+"/include"
lal_libs = lal_prefix+"/lib"
ext_modules=[
Extension(name="cosmolisa.cosmology",
sources=["cosmolisa/cosmology.pyx"],
libraries=['m', "lal"], # Unix-like specific
library_dirs=[lal_libs],
extra_compile_args=['-O3', '-ffast-math'],
include_dirs=[numpy.get_include(), lal_includes, "cosmolisa"]),
Extension(name="cosmolisa.likelihood",
sources=["cosmolisa/likelihood.pyx"],
libraries=['m', "lal"], # Unix-like specific
library_dirs=[lal_libs],
extra_compile_args=['-O3', '-ffast-math'],
include_dirs=[numpy.get_include(), lal_includes, "cosmolisa"]),
Extension("cosmolisa.galaxy",
sources=["cosmolisa/galaxy.pyx"],
libraries=['m', "lal"], # Unix-like specific
library_dirs=[lal_libs],
extra_compile_args=['-O3', '-ffast-math'],
include_dirs=[numpy.get_include(), lal_includes, "cosmolisa"]),
Extension("cosmolisa.astrophysics",
sources=["cosmolisa/astrophysics.pyx"],
libraries=['m', "lal"], # Unix-like specific
library_dirs=[lal_libs],
extra_compile_args=['-O3', '-ffast-math'],
include_dirs=[numpy.get_include(), lal_includes, "cosmolisa"])
]
setup(name="cosmolisa",
ext_modules=cythonize(ext_modules, language_level='3'),
entry_points={'console_scripts':
["cosmoLISA = cosmolisa.cosmological_model:main"]},
include_dirs=[numpy.get_include(), lal_includes, "cosmolisa/cosmolisa"],
description="cosmolisa: a cpnest model for cosmological inference.",
author="Walter Del Pozzo, Danny Laghi",
author_email="walter.delpozzo@ligo.org, danny.laghi@ligo.org",
url="https://github.com/wdpozzo/cosmolisa",
license="MIT",
cmdclass={'build_ext': build_ext},
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',],
keywords="gravitational waves cosmology bayesian inference",
packages=['cosmolisa'],
install_requires=['numpy', 'scipy', 'corner', 'cython'],
package_data={"": ['*.pyx', '*.pxd']},
)