Hall A C++ Analyzer Installation Guide


General

Currently, the C++ Analyzer is distributed only as source code. You will need to compile it yourself. Precompiled versions are problematic because of the large number of possible combinations of ROOT versions and compilers, which are not compatible at the binary level.

Once the analyzer code has become stable, we will provide a pre-installed set of shared libraries on the Hall A counting house Linux cluster and possibly on /apps. These libraries would be matched with a certain version of ROOT also pre-installed on those locations.


System Requirements


Prerequisites

The following software must be installed and set up prior to unpacking and compiling the analyzer:

Getting the analyzer source code

Source distributions can be downloaded from here. Unpack the archive as follows:
  % tar xzf analyzer-1.0.tar.gz
OR
  % gunzip -c analyzer-1.0.tar.gz | tar xf -
The sources will be unpacked into the subdirectory "analyzer-1.0". Go there
  % cd analyzer-1.0

Compilation

First, ensure that ROOT is properly set up. Inspect the value of the environment variable ROOTSYS. It must point to the version of ROOT you intend to use. See if you can start ROOT by typing
  % root
$ROOTSYS/bin must be in your PATH.

Currently, there is no "configure" script that automatically detects and configures system-dependent parameters such as compiler, path to applications, etc. Thus, changing the platform must be done by hand. Fortunately this is rather easy. The default configuration is for Linux. So, on Linux you can simply type

  % make

On Solaris, edit the top-level Makefile and change the value of "ARCH" from "linuxegcs" to "solarisCC5". Then type

  % gmake
On other Unices, you will have to provide an appropriate "ARCH" section in each of the three Makefiles:
  ./Makefile
  hana_decode/Makefile
  hana_scaler/Makefile
Building on ifarml1/2/3

Download the source tarball, unpack, set up ROOT and gcc, and compile:

   % lynx -source http://hallaweb.jlab.org/root/download/analyzer-1.0.tar.gz > analyzer-1.0.tar.gz
   % tar xzvf analyzer-1.0.tar.gz 
   % cd analyzer-1.0
   % use root/3.03-06-gcc3.0.4
   % use gcc/3.0.4
   % make -j4
   ( ... go drink a coffee ... )

   Quick test of the build:

   % setenv LD_LIBRARY_PATH `pwd`:${LD_LIBRARY_PATH}
   % ./analyzer
Recovering from a corrupted build

If you build fails because something wasn't set up right, restarting the build may fail with weird error messages. In such a case, try

  % find . -name '*.d' -exec rm {} \;
  % make realclean
  % make
Only if this fails you are likely to have a real problem with the source code.

Installation

To run the analyzer in an arbitrary directory, a number of environment variables need to be set up. Assuming you built the Analyzer in ~/analyzer-1.0, the setup would be as follows:
For bash (Linux default):

  % export LD_LIBRARY_PATH=~/analyzer-1.0:$ROOTSYS/lib
  % export DB_DIR=~/analyzer-1.0/DB
  % export PATH=~/analyzer-1.0:$PATH

For tcsh (JLab Computer Center default):

  % setenv LD_LIBRARY_PATH ~/analyzer-1.0:${ROOTSYS}/lib
  % setenv DB_DIR ~/analyzer-1.0/DB
  % set path = ( ~/analyzer-1.0 $path )

Instead of adding the build directory to PATH, you could link ~/analyzer-1.0/analyzer to your working directory.

You probably want to put these definitions in your login script: ~/.bash_profile or ~/.login.


Running

Go to your working directory and type:
  % analyzer
or, if you did not modify the PATH:
  % ./analyzer
You should see the startup message:
  ************************************************
  *                                              *
  *            W E L C O M E  to  the            *
  *       H A L L A   C++  A N A L Y Z E R       *
  *                                              *
  *        Release   1.00 RC3        Jun 18 2003 *
  *  Based on ROOT  3.05/04           May 8 2003 *
  *             Development version              *
  *                                              *
  *            For information visit             *
  *        http://hallaweb.jlab.org/root/        *
  *                                              *
  ************************************************

CINT/ROOT C/C++ Interpreter version 5.15.83, Apr 6 2003
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
analyzer [0]
Since the Analyzer is built on top of ROOT, you now have access to all ROOT commands from the Analyzer command prompt. Running the Analyzer is like running ROOT with a bunch of extra classes available. The special Analyzer classes are listed in the Analyzer Class Index.

If you are a new user, you might want to look at the example scripts in the examples/ subdirectory of the distribution. Documentation of them can be found in the Quickstart Guide.


Ole Hansen <ole@jlab.org>
Last modified: Thu Jun 19 13:23:09 EDT 2003