Cantera / enhancements

Repository for proposed and ongoing enhancements to Cantera
11 stars 5 forks source link

Deprecate and remove `setup_cantera` scripts #135

Closed bryanwweber closed 2 years ago

bryanwweber commented 2 years ago

Abstract

Deprecate and remove the two setup_cantera and setup_cantera.csh scripts. Deprecation to occur in v2.6, removal thereafter.

Motivation

I don't think anyone uses these scripts. They pose a minor maintenance burden on SConstruct and they possibly encourage old-school practices such as exporting PYTHONPATH to the environment.

Possible Solutions

  1. Deprecate both scripts by printf statements
  2. Remove them after v2.6 is released

Reversion plan

This issue also exists to collect feedback from folks who are using those scripts. If you use the setup_cantera scripts, please leave a comment here indicating how you use the script! Thank you 😄


The complete setup_cantera script is copied below. The list here gives advice for each of the environment variables previously set in the script.

Hope that helps!

The full script ```shell if [ -z $LD_LIBRARY_PATH ]; then LD_LIBRARY_PATH=@ct_libdir@ else LD_LIBRARY_PATH=@ct_libdir@:$LD_LIBRARY_PATH fi export LD_LIBRARY_PATH if [ -z $PKG_CONFIG_PATH ]; then PKG_CONFIG_PATH=@ct_libdir@/pkgconfig else PKG_CONFIG_PATH=@ct_libdir@/pkgconfig:$PKG_CONFIG_PATH fi export PKG_CONFIG_PATH PYTHON_CMD=@python_cmd@ export PYTHON_CMD PATH=@ct_bindir@:$PATH export PATH if [ "@python_cmd@" != "`which python`" ]; then alias ctpython=@python_cmd@ fi if [ "@matlab_toolbox@" = "y" ]; then if [ -z $MATLABPATH ]; then MATLABPATH=@ct_matlab_dir@:@ct_matlab_dir@/1D else MATLABPATH=$MATLABPATH:@ct_matlab_dir@:@ct_matlab_dir@/1D fi export MATLABPATH fi if [ "@python_module_loc_sc@" != "" ]; then if [ -z $PYTHONPATH ]; then PYTHONPATH=@python_module_loc_sc@ else PYTHONPATH=@python_module_loc_sc@:$PYTHONPATH fi fi export PYTHONPATH ```
shunn337 commented 2 years ago

I just installed 2.6.0b1 and saw this warning message. I've historically sourced cantera_setup from the shell profile as a convenient way to set env variables on systems where I build cantera from source. If the setup script is deprecated, it would still be helpful to summarize what env variables are relevant to include all the cantera modules and libraries. For example, you could print best practices for configuring the env as part of scons install. I install cantera so infrequently that I still find a reminder about this to be useful.

bryanwweber commented 2 years ago

Thanks @shunn337! I edited the first post with some advice. The short answer is that you shouldn't have to do much environment configuration anymore, unless you're doing something custom/more complicated, in which case, it's more challenging to give useful advice.

ischoegl commented 2 years ago

This appears to be relevant to the tutorials on Compiling C++ Programs ... without having paths set, it becomes a little convoluted to have everything set up properly.

speth commented 2 years ago

In what way? The only thing I see on that page that is potentially affected is the setting of PKG_CONFIG_PATH.

ischoegl commented 2 years ago

I'm actually not exactly sure what way. I usually let scons take care of things (i.e. for examples), but failed to set up a simple g++ example within my conda-based tool-chain. pkg-config certainly failed to find things. As I since have tried to set PKG_CONFIG_PATH manually and still failed, there may be other issues though ... an error about a missing cantera.pc is suspicious but would certainly not be fixed by having setup_config.

PS: I agree that cantera_setup should no longer be necessary; the main issue is imho Cantera/cantera-website#191