Getting Started With SCRAM

 

Introduction

SCRAM (an acronym for Software Configuration, Release and Management) is a CMS developed and maintained tool to do all the things the name would suggest. For those of you with any experience with Run II computing here at Fermilab, SCRAM is the CMS equivalent of SoftRelTools.

 

Setting Up The CMS Environment

You need to tell SCRAM a few details about your computing environment. One of those things is the "architecture" of the machine you are using. Again, for those familiar with SoftRelTools, this is the counterpart of $SRT_ARCH. For SCRAM, and on the sorts of machines we will be using (Scientific Linux 3.x on 32-bit, Intel-style processors running gcc 3.2.3) the correct incantation is
source /afs/fnal.gov/files/code/cms/setup/cshrc uaf
setenv SCRAM_ARCH slc3_ia32_gcc323

Just to be sure something useful actually happened and to demonstrate another of the things SCRAM can do for us, we can now issue the command

scram list ORCA

This will produce a list of all the currently installed versions of ORCA on UAF as follows:

Listing installed projects....

--------------------------------------------------------------------------------
| Project Name | Project Version | Project Location |
--------------------------------------------------------------------------------

ORCA ORCA_8_7_3
--> /uscms/prod/sw/cms/Releases/ORCA/ORCA_8_7_3
ORCA ORCA_8_7_1
--> /uscms/prod/sw/cms/Releases/ORCA/ORCA_8_7_1
ORCA ORCA_8_8_0
--> /uscms/prod/sw/cms/Releases/ORCA/ORCA_8_8_0


Projects available for platform >> slc3_ia32_gcc323 <<

 

Suppose you have some code that is known to compile and run properly with some particular release of ORCA - say ORCA_8_7_3 - and want to build the corresponding executable. First you need to make contact with the desired ORCA version. Find or create a convenient directory among your files to serve as a working area for this job. Assuming you are in your login directory, make a subdirectory, go there and get a private copy of the necessary pieces of ORCA you need as in

mkdir work
cd work
scram project ORCA ORCA_8_7_3

This will prepare a set of subdirectories and populate them with files you will need with everything hanging from your directory work.

 

Preparing, Compiling and Running An Example

One of the subdirectories that has been created for you is named ORCA_8_7_3. To download a calorimetry example, do the following:
cd ORCA_8_7_3/src
cmscvsroot ORCA
cvs co -r ORCA_8_7_3 Examples/ExCalorimetry
cd Examples/ExCalorimetry

In that directory, you should find a file named ExDumpCaloTowers.cpp among a number of others. To build an executable program from it, proceed with

scram b
eval `scram runtime -csh`
rehash

The first of these three lines tells SCRAM to build an executable using ExDumpCaloTowers.cpp. The second tells SCRAM to establish the needed run-time environment. This does many things. In particular, it sets $LD_LIBRARY_PATH so that all the shared-object libraries can be found. Finally, the last line makes sure the loader can find the freshly-built executable file. That file was put into the directory ../../../bin/$SCRAM_ARCH and any new libraries produced by the build step were put into the directory ../../../lib/$SCRAM_ARCH. You can verify the location of the executable with the command

which ExDumpCaloTowers

Except for one lingering detail, you are ready to run the example program. You would do that with

ExDumpCaloTowers -c orcarc

where orcarc is a file of metadata that defines all the needed runtime parameters. In this case, that file is not part of the example download and you will need to either construct one on your own or obtain a copy from a colleague or the example maintainer. At this point, you are in a position to, for example, improve the ExDumpCaloTowers.cpp file and become part of the development team!

 


Last updated: June 9, 2005.
This document is maintained by Hans Wenzel (wenzel@fnal.gov) and John Marraffino (marafino@fnal.gov)