HOWTO set up the GlueX environment
Getting the scripts
The scripts mentioned in this HOWTO are available from our Subversion repository:
gluex_env.csh and gluex_env.sh
This is a generic script for defining all of the environment variables necessary to run GlueX software. gluex_env.csh is appropriate for the C-shell and its variants (e. g., csh, tcsh), gluex_env.sh for the Bourne shell and its variants (e. g., sh, bash). It provides sensible defaults and respects existing definitions of certain key variables.
|BMS_OSNAME||taken from local operating system|
|CERN_LEVEL||2006, except 64-bit Linux defalts to 2005|
To invoke the script either
- define the variable BUILD_SCRIPTS to point to the directory where you checked the scripts out or
- have a structure so that the default definition of BUILD_SCRIPTS (see table above) is the right one.
Then the command is
for C-shell and
for Bourne shell.
This will set-up a complete GlueX environment using the defaults listed above. It will also modify the PATH and LD_LIBRARY_PATH variables so that building and running the code will succeed. If any or all of the choices used as default are not what you want, the script will honor any pre-existing values of certain key environment variables and proceed with the set-up deriving dependent variables from these key variables.
Note that these defaults assume a directory structure where the code is built. For example, JANA_HOME is assumed to be $GLUEX_TOP/jana/prod = /usr/local/gluex/jana/prod. If that is not the version you want to use (or not the directory structure you have), you can override the defaults as follows:
setenv JANA_HOME <path-to-my-preferred-jana-home> source $BUILD_SCRIPTS/gluex_env.csh
for C-shell and
export JANA_HOME=<path-to-my-preferred-jana-home> . $BUILD_SCRIPTS/gluex_env.sh
Commands like these can be put into a script themselves for convenience.
Another thing to note is that since gluex_env.csh respects pre-existing definitions, you have to be careful about any pre-existing definitions that may pre-exist. Practically, that means you want to use it from a clean environment (at least GlueX-wise). In other words, it will not fix a messed-up environment for you.
gluex_env_jlab.csh and gluex_env_jlab.sh
These are is wrappers around gluex_env.csh and gluex_env.sh respectively that provide defaults specific to the current production versions on the various platforms in common use at JLab. On the JLab CUE, the directory structure of the GlueX-specific code is nothing like the default structure mentioned above. Some variables are still left override-able by the user, others are hard-wired. The override-able ones are:
Of course, defaults for these override-able variables are still provided. Sourcing gluex_env_jlab.csh(or sh) with give a complete production level environment on the CUE. Adding pre-existing definitions will allow you to customize the environment from there.