From 59083268fddc3f5bea176954faf048e64cf4180f Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 14 Dec 2011 02:20:14 +0000 Subject: [PATCH] Simplified Matlab startup procedure Users can now either source 'setup_cantera' before starting Matlab or run the ctpath.m script after starting Matlab to set the environment variables and paths needed by Cantera. --- tools/src/finish_install.py.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/src/finish_install.py.in b/tools/src/finish_install.py.in index 4e5545316..b40b01e4b 100644 --- a/tools/src/finish_install.py.in +++ b/tools/src/finish_install.py.in @@ -25,6 +25,11 @@ f.write('PYTHON_CMD='+pycmd+'\nexport PYTHON_CMD\n') if pycmd <> 'python': f.write('alias ctpython='+pycmd+'\n') +if build_matlab: + matlabdir = prefix + '/matlab/toolbox/cantera/cantera' + f.write('MATLABPATH=$MATLABPATH:%s/:%s/1D\n' % (matlabdir, matlabdir)) + f.write('export MATLABPATH\n') + ctloc = '-' warn = '' warn2 = '' @@ -115,6 +120,9 @@ 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""") + if build_python: + fm.write("setenv('PYTHON_CMD','%s')\n" % pycmd) + fm.write("setenv('PYTHONPATH', [getenv('PYTHONPATH'), '%s'])\n" % pypath) fm.close() fm = open(ctdir+"/cantera_demos.m","w")