96 lines
3 KiB
Python
96 lines
3 KiB
Python
import sys
|
|
try:
|
|
from distutils.core import setup, Extension
|
|
except:
|
|
print 'could not import distutils. Will try anyway...'
|
|
|
|
libs = []
|
|
platform = sys.platform
|
|
|
|
flibs = '@FLIBS@'
|
|
#linkargs = '@LCXX_FLAGS@'
|
|
|
|
numarray_incl = "@NUMARRAY_INC_DIR@"
|
|
|
|
incdirs=["../../build/include", "src", "../clib/src"]
|
|
|
|
if numarray_incl <> '':
|
|
incdirs.append(numarray_incl)
|
|
|
|
|
|
bllibstr = "@BLAS_LAPACK_LIBS@"
|
|
bllibs = bllibstr.replace('-l',' ')
|
|
bllist = bllibs.split()
|
|
|
|
extra_link = "@EXTRA_LINK@"
|
|
linkargs = extra_link.split()
|
|
|
|
bldirstr = "@LOCAL_LIB_DIRS@"
|
|
bldirs = bldirstr.replace('-L',' ')
|
|
dirlist = bldirs.split()
|
|
libdir = ['@buildlib@']
|
|
for d in dirlist:
|
|
libdir.append(d)
|
|
|
|
if platform == "win32":
|
|
libs = ["clib", "zeroD","oneD","transport",
|
|
"cantera","recipes"] + bllist + ["ctmath", "cvode", "tpx", "converters"]
|
|
else:
|
|
|
|
# The library 'g2c' is needed if the g77 Fortran compiler is
|
|
# used to compile the Fortran-77 procedures in libraries
|
|
# 'recipes', 'ctlapack', 'ctblas', and 'ctmath'. If a different
|
|
# compiler is used, add the appropriate libraries here.
|
|
|
|
libs = ["clib", "zeroD","oneD","transport",
|
|
"cantera","recipes", "converters"] + bllist + ["ctmath", "cvode", "tpx",
|
|
"stdc++", "g2c", "m"]
|
|
|
|
# values:
|
|
# 0 do nothing
|
|
# 1 install only ctml_writer.py
|
|
# 2 install full package
|
|
# 3 try to install full, but install ctml_writer if full package
|
|
# install fails
|
|
buildPython = @BUILD_PYTHON@
|
|
if buildPython >= 2:
|
|
|
|
try:
|
|
setup(name="Cantera",
|
|
version="@ctversion@",
|
|
description="The Cantera Python Interface",
|
|
long_description="""
|
|
""",
|
|
author="Prof. D. G. Goodwin, Caltech",
|
|
author_email="dgoodwin@caltech.edu",
|
|
url="http://www.cantera.org",
|
|
package_dir = {'MixMaster':'../../apps/MixMaster'},
|
|
packages = ["","Cantera","Cantera.OneD",
|
|
"MixMaster","MixMaster.Units"],
|
|
ext_modules=[ Extension("Cantera._cantera",
|
|
["src/pycantera.cpp"],
|
|
include_dirs=incdirs,
|
|
library_dirs = libdir,
|
|
libraries = libs,
|
|
extra_link_args = linkargs
|
|
)
|
|
],
|
|
)
|
|
except:
|
|
buildPython = 1
|
|
|
|
|
|
if buildPython == 1:
|
|
try:
|
|
setup(name="Cantera CTI File Processor",
|
|
version="@ctversion@",
|
|
description="Converts .cti files to CTML",
|
|
long_description="""
|
|
""",
|
|
author="Prof. D. G. Goodwin, Caltech",
|
|
author_email="dgoodwin@caltech.edu",
|
|
url="http://www.cantera.org",
|
|
py_modules = ["ctml_writer"],
|
|
)
|
|
except:
|
|
raise 'Error encountered while building or installing the Cantera CTI file preprocessor!'
|