[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


Folks,

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,

   gxenv

sets up the default version set. Also you can say

   gxenv /path/to/my_version.xml

to set up your favorite version set. Typing

  gxclean

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 
<https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh>. 
The page is also reproduced below.

This is new, so feedback welcome.

   -- Mark

_____________________________________


  gluex_env_boot_jlab.(c)sh

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).


    <https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#how-to-access-the-commands>How
    to Access the Commands

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 |


    <https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#how-to-use-the-commands>How
    to Use the Commands

Usage is the same for both tcsh and bash.


      <https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#to-set-up-the-environment>To
      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 |


      <https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#to-take-down-the-environment>To
      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.


    <https://github.com/JeffersonLab/build_scripts/wiki/gluex_env_boot_jlab.%28c%29sh#why-implement-things-this-way>Why
    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.

<https://github.com/JeffersonLab/build_scripts/wiki/_new?wiki%5Bname%5D=_Footer> 


-- 
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