Fundamental elements Procedures CMT show uses Running Release Manager builds

Developing Utilities for GLAST Ground Software (Linux)

Most of the existing how-to documentation for GLAST Ground Software development assumes the developer is working on something like a complete simulation, reconstruction, or analysis program. Because of the large quantity of packages involved in such a program, significant automation of installation and building is a practical necessity. The developer's interface for these operations is mostly or exclusively that of the automating tools and typically involves the concept of a "checkout package" which acts as an umbrella for all packages of interest.

The utility developer is in a very different situation: there usually is no appropriate checkout package and the total number of relevant packages is probably very small. In this case a much more spartan developer interface, where more is done "by hand", can be more efficient. It also has the side effect of giving the developer more insight into how the system is put together.

Fundamental Elements of the Development Environment

Access to our CVS repository

See this overview of CVS if you're unfamiliar with it. Then follow these instructions to use our repository.

CMT (Code Management Tool)

CMT is a tool which automates building of code packages, keeping track of dependencies between as well as within the packages. See this good short introduction. You can also look at the instructions for getting and installing CMT on unix, but if you're using the SLAC Linux public machines you won't have to bother with this. There is already a public installation and you only need to gain access to it, which you can do by running our group cshrc file, described below.

Packages

Take a look at our repository using CVSweb. You can see all our packages in the long list to the left. Most of the packages with names in all caps, like XMLEXT, are interface packages. They don't actually contain any code; they are just a means to defining appropriate symbols so that our code can find external (imported) libraries and associated include files. Packages whose names start with "Gaudi" are part of the Gaudi framework, really another external library but treated somewhat specially. Almost all the rest contain code written for GLAST. Browse around to get a feel for typical organizations (there is more than one) for these packages, keeping an eye on the "age" column for the file ChangeLog, which is automatically updated whenever anyone makes a change to the package. Any package which hasn't been updated in the last few months is probably not of much interest. Most packages have at least the following subdirectories

External libraries

We use several pre-built external packages. Even the most lowly utility package will probably need access to at least one of these. Usually we need access only to binaries and include files for such packages. They're kept in a special directory defined by the EXTLIB package, which in turn depends on there being a sensible definition of the environment variable GLAST_EXT. At SLAC if you use the group cshrc described in the next section GLAST_EXT will be set properly for you. If you're using a Linux system other than the SLAC cluster, you will probably need to install the external libraries yourself. See the external libraries help page and this list of external libraries used by GLAST software.

group cshrc

We have a script accessible from the SLAC Linux cluster which does much of the common setup needed for GLAST ground software development. You can invoke it as follows:

$ source /afs/slac/g/glast/ground/scripts/group.cshrc

The script

One important function which group.cshrc does not do for you (because it cannot do it sensibly) is the initialization of the environment variable CMTPATH. This is covered in the instructions below.

Some indispensable packages

You can hardly get along without

In the next, still very fundamental, tier are

If any XML is involved, you'll also need

Procedures

Certain steps you need to do at the start of each session (e.g., when you log in). Others need to be done only when you need another package, either because you expect to modify it or just because another package requires it. I'll identify the appropriate time for each step as we go since there isn't a single order which is appropriate for all situations.

Using CMT show uses

In order to find out which packages a given package needs and whether you have them all, go to the cmt or mgr directory of the package and issue the command
   $ cmt show uses 
If all is well you'll get several lines of output like this:
jrb@noric08 $ cmt show uses
# use xml * public
#   use GlastPolicy * public
#     use GaudiPolicy * public
#   use XMLEXT * public
#     use EXTLIB * public
#   use facilities * public
#     use GlastPolicy * public
# use MYSQLEXT * public
#   use EXTLIB * public
#
# Selection :
use CMT v1r10p20011126 /afs/slac.stanford.edu/g/glast/applications
use EXTLIB v2r4p2 /u/ey/jrb/glast/jrbnfs/G4Gen
use MYSQLEXT v0 /u/ey/jrb/glast/jrbnfs/G4Gen
use XMLEXT v2r2 /u/ey/jrb/glast/jrbnfs/G4Gen
use GaudiPolicy v5r4p1 /afs/slac.stanford.edu/g/glast/ground/releases/GaudiSys_v
9r0p4
use GlastPolicy v4r2 /u/ey/jrb/glast/jrbnfs/G4Gen
use facilities v2r2 /u/ey/jrb/glast/jrbnfs/G4Gen
use xml v4r1 /u/ey/jrb/glast/jrbnfs/G4Gen
However if you're missing something the output will look more like this:
jrb@noric08 $ cmt show uses
# package gobbledygook *  not found
# use xml * public
#   use GlastPolicy * public
#     use GaudiPolicy * public
#   use XMLEXT * public
#     use EXTLIB * public
#   use facilities * public
#     use GlastPolicy * public
# use MYSQLEXT * public
#   use EXTLIB * public
# use gobbledygook * public
#
# Selection :
use CMT v1r10p20011126 /afs/slac.stanford.edu/g/glast/applications
# package gobbledygook *  not found
use EXTLIB v2r4p2 /u/ey/jrb/glast/jrbnfs/G4Gen
use MYSQLEXT v0 /u/ey/jrb/glast/jrbnfs/G4Gen
use XMLEXT v2r2 /u/ey/jrb/glast/jrbnfs/G4Gen
use GaudiPolicy v5r4p1 /afs/slac.stanford.edu/g/glast/ground/releases/GaudiSys_v
9r0p4
use GlastPolicy v4r2 /u/ey/jrb/glast/jrbnfs/G4Gen
use facilities v2r2 /u/ey/jrb/glast/jrbnfs/G4Gen
use xml v4r1 /u/ey/jrb/glast/jrbnfs/G4Gen

# CMT> package_not_found - gobbledygook

Back to GLAST Software Home

J. Bogart
Last modified:

Running Release Manager builds (SLAC only)

If you are logged into a public SLAC Linux machine, you have access to all the binaries built by the Release Manager. Currently (as of 8 Oct. 2002) they can be found at /a/sulky07/g.glast.u05/builds/. For example, the Gleam executable for the tag v2r3p3 can be run by issuing the following from the bash shell command line, assuming you have already executed the group .cshrc or equivalent:

  $ LD_LIBRARY_PATH=;export LD_LIBRARY_PATH
  $ cd /a/sulky07/g.glast.u05/builds/Gleam-v2r3p3/Gleam/v2r3p3/cmt
  $ source setup.sh
  $ cd
  $ $GLEAMROOT/Linux-i686/Gleam.exe

The clear of LD_LIBRARY_PATH may not be necessary in all circumstances, but it won't hurt. In order to run Gleam.exe successfully you must be in a directory to which you have write access, hence the preceding cd command. Any other directory to which you may write would do as well.