Generate setup_cantera.csh for use with csh/tcsh

Resolves #453
This commit is contained in:
Ray Speth 2017-12-02 19:49:08 -05:00
parent deeaaed03f
commit 4a4886f63e
3 changed files with 50 additions and 7 deletions

View file

@ -1710,11 +1710,12 @@ def postInstallMessage(target, source, env):
if os.name != 'nt':
install_message += textwrap.dedent("""
A setup script to configure the environment for Cantera is at:
Setup scripts to configure the environment for Cantera are at:
setup script {ct_bindir!s}/setup_cantera
setup script (bash) {ct_bindir!s}/setup_cantera
setup script (csh/tcsh) {ct_bindir!s}/setup_cantera.csh
It is recommended that you run this script by typing:
It is recommended that you run the script for your shell by typing:
source {ct_bindir!s}/setup_cantera

View file

@ -33,10 +33,11 @@ if localenv['layout'] != 'debian' and env['OS'] != 'Windows':
env['python_cmd'] = env['python{}_cmd'.format(major)]
env['python_array_home'] = env['python{}_array_home'.format(major)]
target = env.SubstFile('setup_cantera', 'setup_cantera.in')
localenv.AddPreAction(target, copy_var)
localenv.Depends(target, env['install_python{}_action'.format(major)])
install('$inst_bindir', target)
for script in ['setup_cantera', 'setup_cantera.csh']:
target = env.SubstFile(script, script + '.in')
localenv.AddPreAction(target, copy_var)
localenv.Depends(target, env['install_python{}_action'.format(major)])
install('$inst_bindir', target)
# Cantera.mak include file for Makefile projects
# cantera.pc for use with pkg-config

View file

@ -0,0 +1,41 @@
#!/bin/csh
if (! $?LD_LIBRARY_PATH) then
setenv LD_LIBRARY_PATH @ct_libdir@
else
setenv LD_LIBRARY_PATH @ct_libdir@:$LD_LIBRARY_PATH
endif
if (! $?PKG_CONFIG_PATH) then
setenv PKG_CONFIG_PATH @ct_libdir@/pkgconfig
else
setenv PKG_CONFIG_PATH @ct_libdir@/pkgconfig:$PKG_CONFIG_PATH
endif
setenv PYTHON_CMD @python_cmd@
setenv PATH @ct_bindir@:$PATH
if ("@python_cmd@" != `which python`) then
alias ctpython @python_cmd@
endif
if ("@matlab_toolbox@" == "y") then
if (! $?MATLAB_PATH) then
setenv MATLABPATH @ct_matlab_dir@:@ct_matlab_dir@/1D
else
setenv MATLABPATH $MATLABPATH:@ct_matlab_dir@:@ct_matlab_dir@/1D
endif
endif
if ("@python_module_loc_sc@" != "") then
if (! $?PYTHONPATH) then
setenv PYTHONPATH @python_module_loc_sc@
else
setenv PYTHONPATH @python_module_loc_sc@:$PYTHONPATH
endif
endif
if ("@python_array_home@" != "") then
setenv PYTHONPATH @python_array_home@:$PYTHONPATH
endif