forked from PCMDI/cmor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py.in
executable file
·67 lines (56 loc) · 1.71 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
import numpy
from numpy.distutils.core import setup, Extension
#from numpy.distutils.ccompiler import CCompiler
import os,sys,string
include_dirs = [numpy.lib.utils.get_include(),"include","include/cdTime"]
library_dirs = [ os.path.join("@prefix@","lib") ,'.']
include_dirs.append(os.path.join("@prefix@","include"))
libraries = []
for st in ["@NCLDFLAGS@", "@NCCFLAGS@", "@UDUNITS2FLAGS@", "@UDUNITS2LDFLAGS@", "@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:])
srcfiles = "@LIBSOURCES@".split()
srcfiles.insert(0,os.path.join("Src","_cmormodule.c"))
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='2.0',
author='Charles Doutriaux, PCMDI',
description = "Python Interface to CMOR output library",
url = "http://www-pcmdi.llnl.gov/cmor",
packages = ['cmor'],
package_dir = {'cmor': 'Lib'},
ext_modules = [
Extension('cmor._cmor',
srcfiles,
include_dirs = include_dirs,
library_dirs = library_dirs,
libraries = libraries,
define_macros = macros,
extra_compile_args = [ "@DEBUG@", ]
),
]
)