HOWTO set up the GlueX environment

From GlueXWiki
Revision as of 08:42, 18 May 2010 by Marki (Talk | contribs) (gluex_env.csh)

Jump to: navigation, search

Getting the scripts

The scripts mentioned in this HOWTO are available from our Subversion repository:

svn checkout https://halldsvn.jlab.org/repos/trunk/scripts/build_scripts

gluex_env.csh

This is a generic script for defining all of the environment variables necessary to run GlueX software. It provides sensible defaults and respects existing definitions of certain key variables.

Variable Default Value
GLUEX_TOP /usr/local/gluex
BUILD_SCRIPTS $GLUEX_TOP/build_scripts
XERCESCROOT $GLUEX_TOP/xerces-c/prod
ROOTSYS $GLUEX_TOP/root/prod
CERN $GLUEX_TOP/cernlib
CERN_LEVEL 2006
HDDS_HOME $GLUEX_TOP/hdds/prod
HALLD_HOME $GLUEX_TOP/sim-recon/prod
HALLD_MY $HOME/halld_my
JANA_HOME $GLUEX_TOP/jana/prod
JANA_CALIB_URL file://$GLUEX_TOP/calib
JANA_GEOMETRY_URL xmlfile://$HDDS_HOME/main_HDDS.xml

To invoke the script, you must be running the C shell (or a C-shell-like variant) and either

  1. define the variable BUILD_SCRIPTS to point to the directory where you checked the scripts out or
  2. have a structure so that the default definition of BUILD_SCRIPTS (see table above) is the right one.

Then the command is

source $BUILD_SCRIPTS/gluex_env.csh

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 those environment variables and proceed with the set-up accordingly.

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

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

gluex_env_jlab.csh

This is a wrapper around gluex_env.csh that provides 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:

  • HDDS_HOME
  • HALLD_HOME
  • HALLD_MY
  • JANA_HOME

Of course, defaults are still provided. Sourcing gluex_env_jlab.csh with give a complete production level environment on the CUE. Adding pre-existing definitions will allow you to customize the environment from there.