MIPP Offline Software Installation

Setup external packages

Note: you absolutely have to have all of the following packages in order to build offline software. Click on the link above for details.
  • ROOT
  • Xerces C++
  • CLHEP
  • PostgreSQL
  • CERNLIB & STDHEP to build and run e907mc
  • FLUKA to generate events to be saved into STDHEP file
Make sure that required environment variables are set!

Setup CVS

  • Set environment variable
    CVSROOT = :pserver:e907cvs@cdcvs.fnal.gov:/cvs/e907
  • Set environment variable
    CVS_RSH = ssh
  • If you prefer to write your commit comments in emacs (rather than vi), set environment variable
    EDITOR='emacs -nw'
  • Ask Mark Messier or Rajendran Raja to add your kerberos principal (preferred) and/or ssh identity so that you have read/write access to CVS. Once that is done, you can remove :pserver: from CVSROOT variable. You need that in order to commit code into CVS.

Install SRT (Software Release Tools)

SRT is the system that facilitates writing makefiles and building a complete release -- a set of libraries and binaries.
The recipe below was tested to work as of April '06, but do contact experts if you run into trouble.
  1. Download the bootstrap script from cvs
      cvs co offline/SRT_MIPP/scripts/mipp-srt-bootstrap 
    Or get the file through your browser by clicking here.
  2. Set SRT_DIST evironment variable to directory where you want to install MIPP software
     setenv SRT_DIST /usr/local/mipp 
  3. Execute the bootstrap script
      ./offline/SRT_MIPP/scripts/mipp-srt-bootstrap
    By default this creates four subdirectories in $SRT_DIST:
    bin
    packages
    releases
    srt
    Make sure that srt/project contains the word MIPP.
    If your environment looks ok, you can now remove mipp-srt-bootstrap, as you will no longer need it.
  4. Edit or create (if necessary) the appropriate setup script in
      $SRT_DIST/bin
    that sets the MIPP software variables required for your local machine. Example C-shell and bash scripts for Linux (e907ana cluster setup).
    If you don't see a script that corresponds to your operating system, be kind and commit the one you create into package: offline/setup. Make sure that your script sources $SRT_DIST/srt/srt.csh or $SRT_DIST/srt/srt.sh as appropriate.
    Note: SRT command srt_setup (or aliased as setrel) add information to environment that is not always welcome, but sourcing srt/srt.(c)sh is totally safe for your environment.
  5. Execute the setup script and also enter it in your own login shell startup. For example:
      source /usr/local/mipp/bin/setup_Darwin.sh  # MacOSX
    You now have an environment variable that points to the base directory:
      SRT_DIST = /usr/local/mipp

Import a Release

There are two types of releases: development and fixed.
  • Unless there are reasons to branch code in CVS, development release should be used when you are writing new code.
    • Naming convention for releases is RYY.MM.DD, that is tagged with the date of the release.
  • Unless the latest fixed release is "too old" to be able to run your code, fixed release should be used for lengthy jobs. This is especially true on e907ana machines, since development release is rebuilt nightly.
To import and build development release, do the following:
	mipp-import-rel -rel development
cd $SRT_DIST/releases/development
setrel # If you did not create alias, then srt_setup -a
make
make tbin # This optional command builds "test binaries"
To import a fixed release (say R06.04.07), you would do the following:
	mipp-import-rel -rel R06.04.07
cd $SRT_DIST/releases/R06.04.07
setrel R06.04.07 # It is important to name the release
make
make tbin # Optional
If the commands above are not found by your shell, then you forgot to source the setup script you created in the previous step.

Creating a Private (test) Release

Your "test" release is where you will check out and edit code and compile against the previously created libaries in the public $SRT_DIST area.
In a directory other than $SRT_DIST (say, your home directory)
	 newrel -t development mytest
cd mytest
setrel # To work off fixed release, execute setrel RYY.MM.DD
addpkg -h DSTAnalysis # Get the latest version of DSTAnalysis
make
You should now see libraries and/or binaries made for that package in mytest/lib and mytest/bin.
Note: if you use C-shell, you should execute rehash in order for the shell to pick up binary from the new location.

Creating a New Package

The following recipe is to be followed if you want to add a new package into Offline release. Suppose you want to start package MyReco.
  1. Add the package into offline directory in CVS
    	cvs co offline
    cd offline
    mkdir MyReco
    cvs add MyReco
     
  2. Add package alias to CVSROOT/modules
    	cvs co CVSROOT
    emacs -nw CVSROOT/modules # Add line MyReco mipp/offline/MyReco
    cvs commit CVSROOT
  3. Add package into development release
    	emacs -nw offline/setup/packages-development # Add line MyReco : HEAD
    cvs commit setup
  4. Re-import development release on the machine. For this step you need write access to $SRT_PUBLIC_CONTEXT directory. If you don't, ask your site release admin to re-import the release. The new package needs to be added into the base release before you can addpkg it into your private release.
    	mipp-import-rel -delete -rel development
  5. Now addpkg MyReco will work in your private release, where you can populate it with your code
  6. We strongly recommend that .cvsignore file like this is added into your package. Then you will not accidentally commit core dumps or *.cxx~ files.

Tagging a Release

This is meant to be an expert task. Make sure that you talk to the rest of the collaboration before tagging, although nothing bad will happen if you happen to create a tagged release, but it might be confusing to others.
The task is achieved quite simply: execute
	make-release.pl
The script goes through every package in packages-development, builds it and then creates a CVS tag based on the date (GMT). So far, only one release per day is therefore allowed.
Once the release is tagged you can install it with mipp-import-rel.
Questions/problems/suggestions?

Last update: Jan 3, 2007