Files
cantera/Cantera/python/setup.py.in

121 lines
3.5 KiB
Python
Raw Normal View History

2003-04-14 17:57:48 +00:00
import sys
2008-01-11 20:59:09 +00:00
from distutils.core import setup, Extension
2003-04-20 13:18:09 +00:00
libs = []
2003-04-14 17:57:48 +00:00
platform = sys.platform
2008-01-09 15:37:20 +00:00
flibs = []
if @build_with_f2c@ <> 1:
flibstr = '@FLIBS@'
f1 = flibstr.replace('-l', ' ')
flibs = f1.split()
2007-05-11 19:29:35 +00:00
2007-05-11 20:58:19 +00:00
linkargs = '@LCXX_FLAGS@'
2004-08-03 10:25:03 +00:00
numarray_incl = "@NUMARRAY_INC_DIR@"
incdirs=["../../build/include", "src", "../clib/src"]
if numarray_incl <> '':
incdirs.append(numarray_incl)
2004-07-14 11:24:12 +00:00
bllibstr = "@BLAS_LAPACK_LIBS@"
bllibs = bllibstr.replace('-l',' ')
bllist = bllibs.split()
2005-11-10 20:48:27 +00:00
cvlibstr = "@CVODE_LIBS@"
cvlibs = cvlibstr.replace('-l',' ')
cvlist = cvlibs.split()
2007-01-31 17:33:11 +00:00
thermolib = []
need_cathermo = @NEED_CATHERMO@
if need_cathermo == 1:
thermolib = ["thermo"]
2007-01-31 17:33:11 +00:00
2007-05-11 20:58:19 +00:00
extra_link = linkargs + " " + "@EXTRA_LINK@"
linkargs = extra_link.split()
2004-07-14 11:24:12 +00:00
bldirstr = "@LOCAL_LIB_DIRS@"
bldirs = bldirstr.replace('-L',' ')
dirlist = bldirs.split()
libdir = ['@buildlib@']
for d in dirlist:
libdir.append(d)
2006-04-30 23:10:42 +00:00
endlibstr1 = "@LCXX_END_LIBS@"
endlib1 = endlibstr1.replace('-l', ' ')
endlib = endlib1.split()
2007-05-10 03:28:30 +00:00
locallibstr = "@LOCAL_LIBS@"
local1 = locallibstr.replace('-l', ' ')
locallibs = local1.split()
2003-04-14 17:57:48 +00:00
if platform == "win32":
libs = ["clib", "zeroD","oneD","kinetics", "transport",
"cantera"] + bllist + cvlist + ["ctbase", "ctmath", "tpx"]
2003-04-14 17:57:48 +00:00
else:
2007-05-10 03:28:30 +00:00
libs = ["clib"] + locallibs
2008-01-09 15:37:20 +00:00
#if flibs:
# libs = libs
2007-05-10 03:28:30 +00:00
#libs = ["clib", "zeroD","oneD", "kinetics", "transport",
# "equil", "ctnumerics", "converters"] + thermolib + bllist + cvlist + ["ctbase", "ctmath", "tpx", "boost_thread-mt-1_34"]
2006-04-30 23:10:42 +00:00
if @build_with_f2c@ == 1:
2007-05-12 12:55:25 +00:00
libs.append("ctf2c")
else:
libs = libs + flibs
2006-04-30 23:10:42 +00:00
for d in endlib:
2007-05-12 12:55:25 +00:00
libs.append(d)
2006-04-30 23:10:42 +00:00
2004-07-14 11:24:12 +00:00
# values:
# 0 do nothing
# 1 install only ctml_writer.py
# 2 install full package
buildPython = @BUILD_PYTHON@
if buildPython >= 2:
2003-04-14 17:57:48 +00:00
2008-01-09 15:25:21 +00:00
# try:
setup(name="Cantera",
version="@ctversion@",
description="The Cantera Python Interface",
long_description="""
""",
author="Prof. D. G. Goodwin, Caltech",
author_email="dgoodwin@caltech.edu",
2009-04-04 04:02:16 +00:00
url="http://code.google.com/p/cantera",
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
)
],
)
2008-01-09 15:25:21 +00:00
# except:
# if buildPython == 3:
# buildPython = 1
# else:
# raise 'Error encountered while building or installing the Cantera python modules!'
if buildPython == 1:
2008-01-09 15:25:21 +00:00
# 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"],
)
2008-01-09 15:25:21 +00:00
# except:
# raise 'Error encountered while building or installing the Cantera CTI file preprocessor!'