support for Python-free environments

This commit is contained in:
Dave Goodwin 2006-05-04 02:13:56 +00:00
parent 0cd3336f32
commit 163267f39a
3 changed files with 682 additions and 1374 deletions

1991
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -5,22 +5,24 @@
#
#
test_python=@BUILD_PYTHON@
test_ck=@BUILD_CK@
all:
cd cxx_ex; @MAKE@ all
cd silane_equil; @MAKE@ all
cd surfkin; @MAKE@ all
cd fracCoeff; @MAKE@ all
cd diamondSurf; @MAKE@ all
ifeq ($(test_ck),1)
cd ck2cti_test; @MAKE@ all
endif
test:
cd cxx_ex; @MAKE@ test
cd silane_equil; @MAKE@ test
cd surfkin; @MAKE@ test
cd fracCoeff; @MAKE@ test
cd diamondSurf; @MAKE@ test
ifeq ($(test_ck),1)
cd ck2cti_test; @MAKE@ test
endif
ifeq ($(test_python),2)
cd python; @MAKE@ test
endif
@ -28,20 +30,21 @@ endif
clean:
$(RM) *.*~
cd cxx_ex; @MAKE@ clean
cd silane_equil; @MAKE@ clean
cd surfkin; @MAKE@ clean
cd fracCoeff; @MAKE@ clean
cd diamondSurf; @MAKE@ clean
ifeq ($(test_ck),1)
cd ck2cti_test; @MAKE@ clean
endif
ifeq ($(test_python),2)
cd python; @MAKE@ clean
endif
depends:
cd cxx_ex; @MAKE@ depends
cd silane_equil; @MAKE@ depends
cd surfkin; @MAKE@ depends
cd fracCoeff; @MAKE@ depends
cd diamondSurf; @MAKE@ depends
ifeq ($(test_ck),1)
cd ck2cti_test; @MAKE@ depends
endif

View file

@ -3,6 +3,9 @@ prefix = '@prefix@'
pycmd = '@PYTHON_CMD@' # sys.argv[2]
localinst = @local_inst@
build_python = @BUILD_PYTHON@
build_matlab = @BUILD_MATLAB@
bindir = '@ct_bindir@'
libdir = '@ct_libdir@'
hdrdir = '@ct_incdir@'
@ -25,7 +28,7 @@ if pycmd <> 'python':
ctloc = '-'
warn = ''
warn2 = ''
if localinst:
if localinst and build_python == 2:
try:
v = sys.version_info
ctloc = prefix+'/lib/python'+`v[0]`+'.'+`v[1]`+'/site-packages'
@ -56,15 +59,16 @@ if localinst:
print 'error'
f.close()
# write the script to run MixMaster
f = open(bindir+'/mixmaster','w')
if isdarwin == '1':
f.write('#!/bin/sh\n'+pycmd+"""w -c 'from MixMaster import MixMaster; MixMaster()'
""")
else:
f.write('#!/bin/sh\n'+pycmd+""" -c 'from MixMaster import MixMaster; MixMaster()'
""")
f.close()
if build_python == 2:
# write the script to run MixMaster
f = open(bindir+'/mixmaster','w')
if isdarwin == '1':
f.write('#!/bin/sh\n'+pycmd+"""w -c 'from MixMaster import MixMaster; MixMaster()'
""")
else:
f.write('#!/bin/sh\n'+pycmd+""" -c 'from MixMaster import MixMaster; MixMaster()'
""")
f.close()
# write the script to copy files to build a new app
@ -87,16 +91,17 @@ try:
except:
ctpath = "-"
fm = open(ctdir+"/ctpath.m","w")
fm.write("""path('"""+prefix+"""/matlab/toolbox/cantera/cantera',path)\n""")
fm.write("""path('"""+prefix+"""/matlab/toolbox/cantera/cantera/1D',path)\n""")
fm.close()
if build_matlab:
fm = open(ctdir+"/ctpath.m","w")
fm.write("""path('"""+prefix+"""/matlab/toolbox/cantera/cantera',path)\n""")
fm.write("""path('"""+prefix+"""/matlab/toolbox/cantera/cantera/1D',path)\n""")
fm.close()
fm = open(ctdir+"/cantera_demos.m","w")
fm.write("""ctpath;\n""")
fm.write("""cd demos/matlab;\n""")
fm.write("""run_examples;\n""")
fm.close()
fm = open(ctdir+"/cantera_demos.m","w")
fm.write("""ctpath;\n""")
fm.write("""cd demos/matlab;\n""")
fm.write("""run_examples;\n""")
fm.close()
print """
@ -108,7 +113,10 @@ File locations:
library files """+libdir+"""
C++ headers """+hdrdir+"""
demos """+demodir+"""
data files """+datadir+"""
data files """+datadir
if build_matlab:
print """
Matlab toolbox """+prefix+"""/matlab/toolbox/cantera/cantera
Matlab demos """+prefix+"""/matlab/toolbox/cantera/cantera-demos
@ -122,7 +130,7 @@ if ctpath <> "-":
Python package """+ctpath
if warn <> '':
print warn
else:
else if build_python == 2:
print """
######################################################################
Warning: the Cantera Python package is not installed. If you