forked from LSSTDESC/NaMaster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
53 lines (46 loc) · 1.39 KB
/
setup.py
File metadata and controls
53 lines (46 loc) · 1.39 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python
import sys
from setuptools import setup, Extension
# Get numpy include directory (works across versions)
import numpy
try:
numpy_include = numpy.get_include()
except AttributeError:
numpy_include = numpy.get_numpy_include()
if '--enable-fftw-pthreads' in sys.argv:
sys.argv.pop(sys.argv.index('--enable-fftw-pthreads'))
FFTW_LIBS = ['fftw3', 'fftw3_threads', 'pthread']
else:
FFTW_LIBS = ['fftw3', 'fftw3_omp']
if '--disable-openmp' in sys.argv:
sys.argv.pop(sys.argv.index('--disable-openmp'))
USE_OPENMP = False
else:
USE_OPENMP = True
libs = [
'nmt', 'sharp', 'fftpack', 'c_utils', 'chealpix', 'cfitsio', 'gsl',
'gslcblas', 'm'] + FFTW_LIBS
use_icc = False # Set to True if you compiled libsharp with icc
if use_icc:
extra = []
if USE_OPENMP:
libs += ['gomp', 'iomp5']
extra += ['-openmp']
else:
extra = ['-O4']
if USE_OPENMP:
libs += ['gomp']
extra += ['-fopenmp']
_nmtlib = Extension("_nmtlib",
["pymaster/namaster_wrap.c"],
libraries=libs,
include_dirs=[numpy_include, "../src/"],
extra_compile_args=extra,
)
setup(name="pymaster",
description="Library for pseudo-Cl computation",
author="David Alonso",
version="0.9",
packages=['pymaster'],
ext_modules=[_nmtlib],
)