-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
68 lines (65 loc) · 2.89 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
import os
import numpy as np
from numpy.distutils.core import setup
from numpy.distutils.core import Extension
__version__ = '0.0'
try:
if 'NERSC_HOST' in os.environ.keys():
if os.environ['NERSC_HOST'] == 'edison':
ext = Extension(name='estimator',
sources=['pyspectrum/estimator.f'],
language='f77',
library_dirs = ["/opt/cray/pe/fftw/3.3.8.1/x86_64/lib"],
libraries = ['fftw3f'],
include_dirs=[np.get_include(), "/opt/cray/pe/fftw/3.3.8.1/x86_64/include"])
elif os.environ['NERSC_HOST'] == 'cori':
ext = Extension(name='estimator',
sources=['pyspectrum/estimator.f'],
language='f77',
library_dirs = ["/opt/cray/pe/fftw/default/x86_64/lib"],
libraries = ['fftw3f'],
include_dirs=[np.get_include(), "/opt/cray/pe/fftw/default/x86_64/include"])
else:
raise KeyError
elif 'machine' in os.environ.keys():
if os.environ['machine'] == 'tiger':
print('install on princeton Tiger')
ext = Extension(name='estimator',
sources=['pyspectrum/estimator.f'],
language='f77',
library_dirs = ["/usr/local/fftw/intel-16.0/3.3.4/lib64"],
libraries = ['fftw3f'],
include_dirs=[np.get_include(), "/usr/local/fftw/intel-16.0/3.3.4/include"])
elif os.environ['machine'] == 'mbp':
ext = Extension(name='estimator',
sources=['pyspectrum/estimator.f'],
language='f77',
library_dirs = ["/usr/local/lib"],
libraries = ['fftw3f'],
include_dirs=[np.get_include(), '/usr/local/include'],
extra_f77_compile_args=['-fcheck=all', '-fallow-argument-mismatch'])
else:
raise KeyError
except KeyError:
ext = Extension(name='estimator',
sources=['pyspectrum/estimator.f'],
language='f77',
library_dirs = ["/usr/local/lib"],
libraries = ['fftw3f'],
include_dirs=[np.get_include(), '/usr/local/include'],
extra_f77_compile_args=['-fcheck=all', '-fallow-argument-mismatch'])
if __name__=="__main__":
setup(name = 'pySpectrum',
version = __version__,
description = 'TBD',
author='ChangHoon Hahn',
author_email='[email protected]',
url='',
package_data={'pyspectrum': ['dat/fftw3.f', 'dat/*.pyfftw', 'dat/test_box.hdf5']},
platforms=['*nix'],
license='GPL',
requires = ['numpy', 'scipy', 'h5py', 'pyfftw', 'pytest'],
provides = ['pyspectrum'],
packages = ['pyspectrum'],
ext_modules = [ext]
)