Files
cantera/Cantera/python/setup.py.in
Dave Goodwin 7f570c79ca bug fixes
2007-05-12 12:55:25 +00:00

125 lines
3.6 KiB
Python

import sys
try:
from distutils.core import setup, Extension
except:
print 'could not import distutils. Will try anyway...'
libs = []
platform = sys.platform
flibstr = '@FLIBS@'
f1 = flibstr.replace('-l', ' ')
flibs = f1.split()
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()
cvlibstr = "@CVODE_LIBS@"
cvlibs = cvlibstr.replace('-l',' ')
cvlist = cvlibs.split()
thermolib = []
need_cathermo = @NEED_CATHERMO@
if need_cathermo == 1:
thermolib = ["thermo"]
extra_link = linkargs + " " + "@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)
endlibstr1 = "@LCXX_END_LIBS@"
endlib1 = endlibstr1.replace('-l', ' ')
endlib = endlib1.split()
locallibstr = "@LOCAL_LIBS@"
local1 = locallibstr.replace('-l', ' ')
locallibs = local1.split()
if platform == "win32":
libs = ["clib", "zeroD","oneD","kinetics", "transport",
"cantera"] + bllist + cvlist + ["ctbase", "ctmath", "tpx"]
else:
libs = ["clib"] + locallibs
if flibs:
libs = libs
#libs = ["clib", "zeroD","oneD", "kinetics", "transport",
# "equil", "ctnumerics", "converters"] + thermolib + bllist + cvlist + ["ctbase", "ctmath", "tpx", "boost_thread-mt-1_34"]
if @build_with_f2c@ == 1:
libs.append("ctf2c")
else:
libs = libs + flibs
for d in endlib:
libs.append(d)
# 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:
if buildPython == 3:
buildPython = 1
else:
raise 'Error encountered while building or installing the Cantera python modules!'
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!'