-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
63 lines (49 loc) · 2.43 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
from distutils.core import setup
from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration
from numpy.distutils.core import Extension
import os
import numpy as np
from Cython.Build import cythonize
import glob
import subprocess
# Capture the current git commit to use as version
exec(open("comancpipeline/version.py").read())
try:
slalib_path = os.environ['SLALIB_LIBS']
except KeyError:
slalib_path = '/star/lib' # default path of Manchester machines
print('Warning: No SLALIB_LIBS environment variable set, assuming: {}'.format(slalib_path))
subprocess.run(['f2py','sla.f','pysla.f90','-m','pysla','-h','pysla.pyf','--overwrite-signature'],cwd='comancpipeline/Tools')
os.environ['CFLAGS']='-std=c99'
subprocess.call(['f2py','-c','pysla.pyf','sla.f','pysla.f90'],cwd='comancpipeline/Tools')
filters = Extension(name = 'comancpipeline.Tools.filters',
include_dirs=[np.get_include()],
sources = ['comancpipeline/Tools/filters.pyx'])
ffuncs = Extension(name = 'comancpipeline.Tools.ffuncs',
sources = ['comancpipeline/Tools/ffuncs.f90'])
filters = Extension(name = 'comancpipeline.Tools.median_filter.medfilt',
include_dirs=[np.get_include()],
sources = ['comancpipeline/Tools/median_filter/medfilt.pyx'])
binFuncs = Extension(name='comancpipeline.Tools.binFuncs',
include_dirs=[np.get_include()],
sources=['comancpipeline/Tools/binFuncs.pyx'])
config = {'name':'comancpipeline',
'version':__version__,
'packages':['comancpipeline',
'comancpipeline.RRLs',
'comancpipeline.Analysis',
'comancpipeline.Summary',
'comancpipeline.data',
'comancpipeline.Tools',
'comancpipeline.Simulations',
'comancpipeline.SEDs',
'comancpipeline.SEDs.amemodels',
'comancpipeline.MapMaking'],
'package_data':{'':["*.dat","gains.hd5"]},
'data_files':[('comancpipeline/Tools',glob.glob('comancpipeline/Tools/*pysla*.so'))],
'include_package_data':True,
'ext_modules':cythonize([ffuncs, filters,binFuncs],
compiler_directives={'language_level':"3"})}
setup(**config)
print(__version__)