-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
38 lines (31 loc) · 1.45 KB
/
setup.py
File metadata and controls
38 lines (31 loc) · 1.45 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
from setuptools import setup, Extension, find_packages
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import os
from distutils.sysconfig import get_python_lib
os.environ["CC"] = "g++"
os.environ["CXX"] = "g++"
if 'LDFLAGS' in os.environ.keys():
ldfl=os.environ['LDFLAGS']
new_ldfl=ldfl.replace('-Wl,-dead_strip_dylibs ','')
os.environ['LDFLAGS']=new_ldfl
pathtopythonlib=get_python_lib()
extensions=Extension(name="euclidemu2",
sources=["src/euclidemu2.pyx","src/cosmo.cxx","src/emulator.cxx"],
include_dirs=["/usr/local/include","../src/"],
libraries=["gsl","gslcblas"],
extra_link_args=['-L/usr/local/lib'],
language="c++",
extra_compile_args=['-std=c++11',
'-D PRINT_FLAG=0',
'-D PATH_TO_EE2_DATA_FILE="'+pathtopythonlib+'/euclidemu2/ee2_bindata.dat"']
)
setup(name='euclidemu2',
cmdclass={'build_ext': build_ext},
ext_modules = cythonize(extensions,language_level = 3),
packages=['euclidemu2'],
package_dir={'euclidemu2': 'src'},
package_data={'euclidemu2': ["ee2_bindata.dat","cosmo.h","emulator.h","units_and_constants.h"]},
include_package_data=True,
install_requires=['cython','numpy','scipy']
)