Difference between revisions of "GlueX Software Setup"

From GlueXWiki
Jump to: navigation, search
(Base Environment)
(User-Specific Environment Setup)
Line 38: Line 38:
 
* 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 plugins are installed. This should call the desired release-specific build. For example, '''env_gluex_user.csh''':
 
* 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 plugins are installed. This should call the desired release-specific build. For example, '''env_gluex_user.csh''':
  
<pre>
+
<syntaxhighlight>
 
# Set personal path (This usually corresponds to the home area of the trunk (e.g. https://halldsvn.jlab.org/repos/trunk/home/pmatt/))
 
# Set personal path (This usually corresponds to the home area of the trunk (e.g. https://halldsvn.jlab.org/repos/trunk/home/pmatt/))
 
setenv HALLD_MY /home/$USER/gluex/home/$USER/
 
setenv HALLD_MY /home/$USER/gluex/home/$USER/
Line 44: Line 44:
 
# Source the release environment
 
# Source the release environment
 
source /home/gluex/env_gluex_2014_06_30_rhel6
 
source /home/gluex/env_gluex_2014_06_30_rhel6
</pre>
+
</syntaxhighlight>
  
 
* 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''':
 
* 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''':

Revision as of 18:23, 17 July 2014

Offline Software Overview

Required Lab-External Software

Required Lab-Internal Software

Optional Software

  • AmpTools:

Build Dependencies

  • If you re-build one of the following, you must also rebuild (in order):
Xerces: HDDS, JANA, sim-recon
ROOT: JANA, sim-recon
CCDB: JANA, sim-recon
HDDS: sim-recon
JANA: sim-recon
EVIO: sim-recon

Environment

  • There should be three levels for the software environment: user-specific, release-specific, and base. 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 ...

User-Specific 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 plugins are installed. This should call the desired release-specific build. For example, env_gluex_user.csh:
# Set personal path (This usually corresponds to the 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:
# (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

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

### DEFINE RELEASE-DEPENDENT VARIABLES (BASE_FOLDERS/VERSIONS/TAGS/BRANCHES/ETC.)

if ( ! $?GLUEX_SCRIPTS ) then
   setenv GLUEX_SCRIPTS /home/gluex/scripts/scripts_r14152/
endif

setenv BMS_OSNAME `$GLUEX_SCRIPTS/osrelease.pl`

if ( ! $?CERN ) then
   setenv CERN /usr/local/cern_64
endif

if ( ! $?CERN_LEVEL ) then
   setenv CERN_LEVEL 2005
endif

if ( ! $?XERCESCROOT ) then
   setenv XERCESCROOT /home/gluex/xerces/xerces-c-3.1.1/
endif

if ( ! $?CLHEP ) then
   setenv CLHEP /home/gluex/clhep/2.1.3.1_rhel6/
endif

if ( ! $?GSL_HOME ) then
   setenv GSL_HOME /home/gluex/gsl/gsl-1.16_rhel6/
endif

if ( ! $?ROOTSYS ) then
   setenv ROOTSYS /home/gluex/root/v5-34-14_rhel6/
endif

if ( ! $?CCDB_HOME ) then
   setenv CCDB_HOME /home/gluex/ccdb/ccdb_1.02_rhel6/
endif

if ( ! $?JANA_HOME ) then
   setenv JANA_HOME /home/gluex/jana/jana_0.7.1p3/${BMS_OSNAME}/
endif

if ( ! $?HDDS_HOME ) then
   setenv HDDS_HOME /home/gluex/hdds/hdds-2.1/
endif

if ( ! $?AMPTOOLS_HOME ) then
     setenv AMPTOOLS_HOME /home/gluex/AmpTools/AmpTools_0.6.2/
endif

if ( ! $?HALLD_HOME ) then
   setenv HALLD_HOME /home/gluex/sim-recon/sim-recon-2014-06-30/
endif

if ( ! $?JANA_RESOURCE_DIR ) then
   setenv JANA_RESOURCE_DIR /home/gluex/resources/
endif

if ( ! $?SQLITE_PATH ) then
   setenv SQLITE_PATH /home/gluex/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 /home/gluex/env_gluex_base

Base Environment

  • 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