[Halld-offline] New recommendation for setting up the GlueX environment (at JLab)

Mark Ito marki at jlab.org
Fri Aug 31 11:38:01 EDT 2018


I've written a few lines that, when sourced, should help with setting up 
the software environment at JLab. They provide succinct commands for the 
task, namely *gxenv* and *gxclean*. Once the commands are defined,


sets up the default version set. Also you can say

   gxenv /path/to/my_version.xml

to set up your favorite version set. Typing


removes all GlueX-related bits from your environment.

Both tcsh and bash are supported. For tcsh, include the following line 
in your |.cshrc|, |.login|, or |.tcshrc|:

|source /group/halld/Software/build_scripts/gluex_env_boot_jlab.csh |

For bash, include the following line in your |.bashrc| or |.profile|:

|source /group/halld/Software/build_scripts/gluex_env_boot_jlab.sh |

Find further documentation by clicking here 
The page is also reproduced below.

This is new, so feedback welcome.

   -- Mark



These scripts provide two "commands" (aliases for tcsh, functions for 
bash) that facilitate setting up and tearing down the GlueX software 
environment at JLab.

|gxenv gxclean |

By defining these commands, the scripts "boot-up" environment setting.

The scripts also provide an environment variable, |DIST|, that points to 
the directory containing all of the official version set files (the 
|version_*.xml| files).

    to Access the Commands

For tcsh, include the following line in your |.cshrc|, |.login|, or 

|source /group/halld/Software/build_scripts/gluex_env_boot_jlab.csh |

For bash, include the following line in your |.bashrc| or |.profile|:

|source /group/halld/Software/build_scripts/gluex_env_boot_jlab.sh |

    to Use the Commands

Usage is the same for both tcsh and bash.

      Set-Up the Environment

To get the default environment:

|gxenv |

To get the environment for a particular official version set, say 
|version_3.5_jlab.xml|, use the |DIST| environment variable:

|gxenv $DIST/version_3.5_jlab.xml |

To get the environment for an arbitrary xml file, use its path:

|gxenv /path/to/my_version.xml |

      Take-Down the Environment

To clear all of the GlueX-specific parts of the environment, including 
GlueX-specific path elements (e. g., those in |PATH|):

|gxclean |

This is not guaranteed to completely clean all gluexy things in all 
circumstances, but should work well when using |gxenv| to do the set-up.

    Implement Things This Way?

...or why not just do the set-up in the |.*rc| file?

The underlying set-up command, |gluex_env_jlab.(c)sh|, has become a bit 
heavy. You may not want to have it executed everytime you start a new 
sub-shell. Also having the version set hard-wired in your initial 
environment can be confusing if you change version sets depending on 
what you are working on. For these reasons, putting the set-up in the 
global shell set-up is not recommended. Sourcing these scripts is very 
fast and once sourced, it is easy to switch from one version set to 
another, even from the command line.


Mark Ito, marki at jlab.org, (757)269-5295

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20180831/90bb78e0/attachment.html>

More information about the Halld-offline mailing list