Difference between revisions of "Quick Start Guide to building GlueX Software"

From GlueXWiki
Jump to: navigation, search
(expand the new section)
Line 49: Line 49:
 
  cd $HOME
 
  cd $HOME
 
  mkdir run
 
  mkdir run
 +
cd run
  
 
==Refresh the path==
 
==Refresh the path==
Line 56: Line 57:
 
==Run the Monte Carlo==
 
==Run the Monte Carlo==
  
cd $HOME/run
 
 
  cp $HALLD_HOME/src/programs/Simulation/HDGeant/control.in .
 
  cp $HALLD_HOME/src/programs/Simulation/HDGeant/control.in .
 
  hdgeant
 
  hdgeant
 +
 +
==Smear the hits==
 +
 +
mcsmear hdgeant.hddm
  
 
==Run the analysis==
 
==Run the analysis==
  
cd $HOME/run
+
  hd_root hdgeant_smeared.hddm
  hd_root hdgeant.hddm
+
  
 
=What if I don't have the prerequisites?=
 
=What if I don't have the prerequisites?=

Revision as of 11:44, 13 January 2010

Prerequisites

You gotta start somewhere. Here that means you need Xerces-C, Cernlib, and Root. The following need to be defined first:

  • XERCESCROOT
  • ROOTSYS
  • CERN
  • CERN_LEVEL

Here is an example of a working definition on ifarml5 (running Fedora 8):

setenv XERCESCROOT /group/halld/Software/ExternalPackages/xerces-c-src_2_7_0.Linux_Fedora8-i686-gcc4.1.2
setenv ROOTSYS /apps/root/PRO/root
setenv CERN /apps/cernlib/i386_fc8
setenv CERN_LEVEL 2005

and an example for jlabl3 (running RHEL5):

setenv XERCESCROOT /group/halld/Software/ExternalPackages/xerces-c-src_2_7_0.Linux_RHEL5-i686-gcc4.1.2
setenv ROOTSYS /apps/root/PRO/root
setenv CERN /apps/cernlib/i386_rhel5
setenv CERN_LEVEL 2005

Check-out and build

The following will checkout out and build jana, hdds, and the GlueX source tree in the current directory:

setenv GLUEX_TOP `pwd`
svn checkout https://halldsvn.jlab.org/repos/trunk/scripts/build_scripts
source build_scripts/gluex_env.csh
set make_targets="jana_build hdds_build halld_build"
make -f $BUILD_SCRIPTS/Makefile_all $make_targets

These five lines can also be found in trunk/scripts/build_scripts/boot.csh as an executable script (the second line checks out the boot_scripts directory).

Run the code

Again you have to start somewhere. Let's assume that you want to get the default calibration, create a directory to run the code, update your path, run the default configuration of the Monte Carlo and reconstruct the result with a default analysis code.

Get the calibration

cd $GLUEX_TOP
make -f $BUILD_SCRIPTS/Makefile_all calib_make

Create a run directory

An example:

cd $HOME
mkdir run
cd run

Refresh the path

rehash

Run the Monte Carlo

cp $HALLD_HOME/src/programs/Simulation/HDGeant/control.in .
hdgeant

Smear the hits

mcsmear hdgeant.hddm

Run the analysis

hd_root hdgeant_smeared.hddm

What if I don't have the prerequisites?

If the system you are on does not have Xerces-C, ROOT, or CERNLIB, there are targets in Makefile_all that can build these for you (although YMMV). For example if you do not have xerces on your system then you can modify the instructions above as follows:

  1. Do not set the XERCESCROOT environment on your own (as described in the "pre-requisites" section above). gluex_env.csh will do that for you.
  2. Add the target "xerces_build" to the "make_targets" environment variable (as described in the "check-out and build" section above), i. e., say
    set make_targets="xerces_build jana_build hdds_build halld_build"
    

Likewise you can build ROOT and CERNLIB in a similar manner. The appropriate targets are "cernlib_build" and "root_build" respectively.