-
Notifications
You must be signed in to change notification settings - Fork 33
/
setup.py.in
executable file
·89 lines (78 loc) · 2.58 KB
/
setup.py.in
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
82
83
84
85
86
87
88
from __future__ import print_function
import numpy
import os
from setuptools import setup, Extension
include_dirs = [numpy.get_include(),"include","include/cdTime"]
library_dirs = [ os.path.join("@prefix@","lib") ,'.']
include_dirs.append(os.path.join("@prefix@","include"))
libraries = []
link_args = []
for st in ["@NCLDFLAGS@", "@NCCFLAGS@",
"@UDUNITS2FLAGS@", "@UDUNITS2LDFLAGS@",
"@JSONCFLAGS@", "@JSONCLDFLAGS@",
"@UUIDFLAGS@", "@UUIDLDFLAGS@"]:
sp = st.strip().split()
for s in sp:
if s[:2]=='-L':
library_dirs.append(s[2:])
if s[:2]=='-l':
libraries.append(s[2:])
if s[:2]=='-I':
include_dirs.append(s[2:])
if s[:4]=='-Wl,':
link_args.append(s)
srcfiles = "@LIBSOURCES@".split()
srcfiles_CV = "@LIBSOURCESCV@".split()
macros=[]
for m in "@MACROS@".split():
macros.append((m[2:],None))
ld =[]
for p in library_dirs:
if os.path.exists(p):
ld.append(p)
library_dirs=ld
ld =[]
for p in include_dirs:
if os.path.exists(p):
ld.append(p)
include_dirs=ld
print('Setting up python module with:')
print('libraries:',libraries)
print('libdir:',library_dirs)
print('incdir',include_dirs)
print('src:',srcfiles)
print('macros:',macros)
setup (name = "CMOR",
version='3.9.0',
author='Chris Mauzey, AIMS',
description = "Python Interface to CMOR output library",
url = "http://cmor.llnl.gov/",
zip_safe=False,
packages = ['cmor', 'cmip6_cv', 'cmor.Test', 'cmip6_cv.PrePARE' ],
package_dir = {'cmor': 'Lib', 'cmip6_cv': 'LibCV', 'cmor.Test':'Test', 'cmip6_cv.PrePARE':'LibCV/PrePARE'},
package_data={'cmip6_cv.PrePARE': ['out_names_tests.json']},
# scripts=['scripts/PrePARE.py' ],
ext_modules = [
Extension('cmor._cmor',
srcfiles,
include_dirs = include_dirs,
library_dirs = library_dirs,
libraries = libraries,
define_macros = macros,
extra_compile_args = [ "-DgFortran"],
extra_link_args = link_args
),
Extension('cmip6_cv._cmip6_cv',
srcfiles_CV,
include_dirs = include_dirs,
library_dirs = library_dirs,
libraries = libraries,
define_macros = macros,
extra_compile_args = [ "-DgFortran"],
extra_link_args = link_args
),
],
entry_points = {
'console_scripts':['PrePARE=cmip6_cv.PrePARE:main'],
}
)