GlueX Software Setup

From GlueXWiki
Jump to: navigation, search

On the ifarm Nodes

On your personal JLab CUE Machine

On your offsite machine, from scratch

On your offsite machine, from scratch

Offline Software Overview

  • For the environment variables below, set them equal to the top-level directory for the given software (e.g. equal to the folder of the tagged release).
    • Exceptions:
    • $JANA_HOME should be the directory that will end up containing the built software, at the location parallel to the src folder (e.g. if src is at /home/gluex/jana/jana_0.7.1p3/src/, then $JANA_HOME is (e.g. setenv JANA_HOME /home/gluex/jana/jana_0.7.1p3/Linux_RHEL6-x86_64-gcc4.4.7/)


Required Lab-External Software

Software Explicit Dependencies Homepage Releases Trunk Environment Variable Miscellaneous
Xerces Link Link XERCESCROOT
CERNLib Link CERN, CERN_LEVEL CERNLib Installation Notes, OpenMotif
ROOT Link Link (e.g. root_v5.34.19.source.tar.gz) ROOTSYS Installing


Required Lab-Internal Software

Software Explicit Dependencies Homepage Releases Trunk Environment Variable(s) Miscellaneous
CCDB Link Link CCDB_HOME
JANA Xerces, ROOT, CCDB Downloads, Tagged Releases Link JANA_HOME
EVIO
HDDS Xerces Link Link HDDS_HOME
Hall-D sim-recon Xerces, ROOT, CCDB, JANA, HDDS, EVIO Link Link HALLD_HOME
Hall-D scripts Link GLUEX_SCRIPTS


Optional Software

  • AmpTools:

Environment

  • There should be three tiers for the software environment: Personal, Release, and Base.
  • Rant: For best-practice, environment variables should NEVER EVER (!!) be put in your .cshrc (or equivalent) file. This is because if you ever need to switch between environments (e.g. between a "data challenge" release and the latest trunk) it gets very messy and it's very easy to make a mistake. It's far safer (and cleaner) to keep everything separate. Ignore this at your own peril ...

Release Environment Setup

  • For each coherent release of the software, an environment file should be used to specify the versions/paths to all of the software used. It should then call the base environment file, which will setup everything else needed (e.g. $PATH, $LD_LIBRARY_PATH). For example, env_gluex_2014_06_30_rhel6:
#!/bin/csh -f
 
if ( ! $?CERN ) then
   setenv CERN /usr/local/cern_64
endif
 
if ( ! $?CERN_LEVEL ) then
   setenv CERN_LEVEL 2005
endif
 
setenv GLUEX_TOP /home/gluex/
 
### DEFINE RELEASE-DEPENDENT VARIABLES (BASE_FOLDERS/VERSIONS/TAGS/BRANCHES/ETC.)
 
if ( ! $?GLUEX_SCRIPTS ) then
   setenv GLUEX_SCRIPTS ${GLUEX_TOP}/scripts/scripts_r14152/
endif
 
setenv BMS_OSNAME `$GLUEX_SCRIPTS/osrelease.pl`
 
if ( ! $?XERCESCROOT ) then
   setenv XERCESCROOT ${GLUEX_TOP}/xerces/xerces-c-3.1.1/
endif
 
if ( ! $?CLHEP ) then
   setenv CLHEP ${GLUEX_TOP}/clhep/2.1.3.1_rhel6/
endif
 
if ( ! $?GSL_HOME ) then
   setenv GSL_HOME ${GLUEX_TOP}/gsl/gsl-1.16_rhel6/
endif
 
if ( ! $?ROOTSYS ) then
   setenv ROOTSYS ${GLUEX_TOP}/root/v5-34-14_rhel6/
endif
 
if ( ! $?CCDB_HOME ) then
   setenv CCDB_HOME ${GLUEX_TOP}/ccdb/ccdb_1.02_rhel6/
endif
 
if ( ! $?JANA_HOME ) then
   setenv JANA_HOME ${GLUEX_TOP}/jana/jana_0.7.1p3/${BMS_OSNAME}/
endif
 
if ( ! $?HDDS_HOME ) then
   setenv HDDS_HOME ${GLUEX_TOP}/hdds/hdds-2.1/
endif
 
if ( ! $?AMPTOOLS_HOME ) then
     setenv AMPTOOLS_HOME ${GLUEX_TOP}/AmpTools/AmpTools_0.6.2/
endif
 
if ( ! $?HALLD_HOME ) then
   setenv HALLD_HOME ${GLUEX_TOP}/sim-recon/sim-recon-2014-06-30/
endif
 
if ( ! $?JANA_RESOURCE_DIR ) then
   setenv JANA_RESOURCE_DIR ${GLUEX_TOP}/resources/
endif
 
if ( ! $?SQLITE_PATH ) then
   setenv SQLITE_PATH ${GLUEX_TOP}/ccdb/sqlite/ccdb_2014-06-28.sqlite
endif
 
if ( ! $?USE_SQLITE ) then
   setenv USE_SQLITE 1 # if 0, get constants directly from the database server
endif
 
### SET ENVIRONMENT
source ${GLUEX_TOP}/env_gluex_base

Base Environment Setup

  • There should be a single file that sets up the rest of the environment variables, such as $PATH and $LD_LIBRARY_PATH. For example, env_gluex_base:
#!/bin/csh -f
 
# Make sure LD_LIBRARY_PATH is set
if ( ! $?LD_LIBRARY_PATH ) then
   setenv LD_LIBRARY_PATH
endif
 
# CERNLIB
setenv LD_LIBRARY_PATH ${CERN}/${CERN_LEVEL}/lib:$LD_LIBRARY_PATH
setenv PATH ${CERN}/${CERN_LEVEL}/bin:$PATH
 
# XERCES
setenv LD_LIBRARY_PATH ${XERCESCROOT}/lib:$LD_LIBRARY_PATH
setenv PATH ${XERCESCROOT}/bin:$PATH
 
# CLHEP
setenv CLHEP_INCLUDE $CLHEP/include
setenv CLHEP_LIB $CLHEP/lib
setenv LD_LIBRARY_PATH ${CLHEP_LIB}:${LD_LIBRARY_PATH}
setenv CLHEP_INCLUDE_DIR $CLHEP_INCLUDE
 
# GSL
if ($?GSL_HOME) then
   setenv LD_LIBRARY_PATH $GSL_HOME/build/lib/:$LD_LIBRARY_PATH
endif
 
# ROOT
setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:$LD_LIBRARY_PATH
setenv PATH ${ROOTSYS}/bin:$PATH
 
# CCDB
source $CCDB_HOME/environment.csh
if ($?USE_SQLITE) then
   setenv CCDB_CONNECTION sqlite:///${SQLITE_PATH}
else
   setenv CCDB_CONNECTION mysql://ccdb_user@hallddb/ccdb
endif
 
# JANA
if ($?USE_SQLITE) then
   setenv JANA_CALIB_URL sqlite:///${SQLITE_PATH}
else
   setenv JANA_CALIB_URL mysql://ccdb_user@hallddb.jlab.org/ccdb
endif
setenv JANA_GEOMETRY_URL xmlfile://$HDDS_HOME/main_HDDS.xml
setenv JANA_PLUGIN_PATH ${HALLD_HOME}/lib/${BMS_OSNAME}:${JANA_HOME}/lib
setenv PATH ${JANA_HOME}/bin:${JANA_HOME}/bin:$PATH
setenv LD_LIBRARY_PATH ${JANA_HOME}/lib:$LD_LIBRARY_PATH
 
# AMPTOOLS
if($?AMPTOOLS_HOME) then
   setenv AMPTOOLS $AMPTOOLS_HOME/AmpTools
   setenv AMPPLOTTER $AMPTOOLS_HOME/AmpPlotter
endif
 
# HALL D PATH
setenv LD_LIBRARY_PATH ${HALLD_HOME}/${BMS_OSNAME}/lib:$LD_LIBRARY_PATH
setenv PATH ${HALLD_HOME}/${BMS_OSNAME}/bin:$PATH
 
# HALL D PERSONAL
if ($?HALLD_MY) then
   setenv JANA_PLUGIN_PATH ${HALLD_MY}/lib/${BMS_OSNAME}:$JANA_PLUGIN_PATH
   setenv LD_LIBRARY_PATH ${HALLD_MY}/${BMS_OSNAME}/plugins/:$LD_LIBRARY_PATH
   setenv PATH ${HALLD_MY}/bin/${BMS_OSNAME}:$PATH
endif

Personal Environment Setup

  • This is so that users can link against a centrally-managed release. For example, they can define their $HALLD_MY variable here, which specifies where their personal plugins are installed. This should then call the desired release-specific environment file. For example, env_gluex_user.csh:
#!/bin/csh -f
 
# Set personal path (This usually corresponds to their home area of the trunk (e.g. https://halldsvn.jlab.org/repos/trunk/home/pmatt/))
setenv HALLD_MY /home/$USER/gluex/home/$USER/
 
# Source the release environment
source /home/gluex/env_gluex_2014_06_30_rhel6
  • Also, advanced users (e.g. developers) can use this to override the release-specific variables (e.g. A test build of sim-recon ($HALLD_HOME)). For example, env_gluex_development.csh:
#!/bin/csh -f
 
# (FOR DEVELOPERS ONLY): Override release-specific HALLD_HOME (or other software paths) for custom (i.e. development) builds.
setenv HALLD_HOME /home/$USER/gluex/sim-recon/development/
 
# Source the release environment
source /home/gluex/env_gluex_2014_06_30_rhel6

Building