| Fundamental elements | Procedures | CMT show uses | Running Release Manager builds |
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.
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.
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
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.
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.
You can hardly get along without
In the next, still very fundamental, tier are
If any XML is involved, you'll also need
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.
$ setenv CMTPATH ~me/myRootor
$ CMTPATH=~me/myRoot; export CMTPATHIf you are developing code which depends on Gaudi (that is, on more than just the GaudiPolicy package) on the SLAC unix system you'll probably want to point to the pre-built Gaudi binaries at SLAC rather than building it yourself. You do this by adding another directory to your CMTPATH:
$ setenv CMTPATH ${CMTPATH}:/afs/slac.stanford.edu/g/glast/ground/releases/GaudiSys_v9r0p5
or
$ CMTPATH=${CMTPATH}:/afs/slac.stanford.edu/g/glast/ground/releases/GaudiSys_v9r0p5; export CMTPATH
These commands reference the installation currently-supported
version of Gaudi, version 9. Slight variants will be required the next time
we upgrade Gaudi.
$ cd ~me/myRoot $ mkdir stable $ cd stable $ cvs checkout -r v3r2 -d v3r2 stable $ cd .. $ mkdir newStuff $ cd newStuff $ cvs checkout -d v1r2 newStuffOf course you don't have to do things in precisely this order. The first checkout command has an -r flag because we want a particular version. The second one just checks out the HEAD and puts it in a directory named to match our best guess of what the new stuff we're working on will ultimately be tagged with. Under the new subdirectories stable/v3r2 and newStuff/v1r2 you should see a structure which looks very much like what you see in CVSweb for these packages. To check out a new version of a package you already have, just cd to the appropriate place, e.g., ~me/myRoot/stable, and issue the checkout command. It can save confusion if you get rid of your old version of stable, but it's not necessary. Sometimes it can be useful to keep it around for comparison.
$ cmt configYou should have new files called setup.sh and setup.csh, among others. You can define all the symbols needed to build the package by running whichever is appropriate for your shell, e.g.
$ source setup.shThe next time you log on you won't have to redo the config step, but, directly or indirectly, you will have to run setup.
$ bash
$ gmake
$ cmt show usesIf 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/G4GenHowever 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
J. Bogart
Last modified:
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.