Build and install osc_vis on CERN/lxplus for LHCb/Panoramix

Here we describe more specifically how to build and install on CERN lxplus cluster by using the "LGC externals" needed to use osc_vis/17.x in LHCb/Panoramix.

Prepare the build

We have put some material under the afs path :

     /afs/cern.ch/sw/contrib/osc_vis/17.0.1/x86_64-slc6-gcc46-opt/build

(take care of 17.0.1 and not 17.0). In the following we shall name this path

     BUILD_PATH

as if defined and used as an environment variable.

Prepare a writable build directory somewhere. We shall name it BUILD_DIR.

     lxplus> <make BUILD_DIR>
     lxplus> <cd BUILD_DIR>     

Get the osc_vis_source_17.0.zip, or from the download area :

http://softinex.lal.in2p3.fr/download/osc

or by copying the zip file from the BUILD_PATH area :

     lxplus> cp $BUILD_PATH/osc_vis_source_17.0.zip .

Then :

     lxplus> unzip -q osc_vis_source_17.0.zip     
     lxplus> cd osc_vis

Choose the wanted compiler :

     lxplus> cp $BUILD_PATH/gcc_setup.sh .
     lxplus> cp $BUILD_PATH/gcc_setup.csh .
     lxplus> <edit gcc_setup.sh, gcc_setup.csh to access the wanted
             compiler found in the lcg area>

Setup the wanted compiler :

         sh> . ./gcc_setup.sh     
 or if under a csh flavoured shell :
        csh> source gcc_setup.csh

Verify the compiler version :

     lxplus> g++ --version

Customize the Python accessor of the osc_vis build shell scripts :

     lxplus> cp $BUILD_PATH/use_Python ./inexlib/exlib/mgr/.
     lxplus> <edit ./inexlib/exlib/mgr/use_Python>

The relevant things to customize are around :

     elif [ "${lcg_area}" != "" ] ; then

Get rid of what is in between :

     if   [ "${BUILD_CONFIG}" = "x86_64-slc5-gcc43-opt" ] ; then
     ...
     fi

and put the version of Python you want, for example :

     Python_vers=2.7
     Python_home="${lcg_area}/Python/2.7.3/x86_64-slc6-gcc46-opt"

The same for the Qt accessor of the osc_vis build shell scripts :

     lxplus> cp $BUILD_PATH/use_Qt ./inexlib/exlib/mgr/.
     lxplus> <edit ./inexlib/exlib/mgr/use_Qt>

The relevant things to customize are around :

     elif [ "${lcg_area}" != "" ] ; then

Get rid of what is in between :

     if   [ "${BUILD_CONFIG}" = "x86_64-slc5-gcc43-opt" ] ; then
     ...
     fi

and put the version of Qt you want, for example :

     Qt_home="${lcg_area}/qt/4.8.3/x86_64-slc6-gcc46-opt"

Note that compilers and various system commands can be customized in :

     ./inexlib/inlib/mgr/use_cc
     ./inexlib/inlib/mgr/use_cpp
     ./inexlib/inlib/mgr/use_sys

Build

Now things are ready for the build. Build first what is "C/C++ only" and then not related to Python, Qt (gtk, Xt) with :

    lxplus> ./build -v

("-v" is to get some verbosity. You can use "-x" if wanting to see all what is done, and in particular the compilation commands).

If ok, then build things related to various groups/drivers, here at least :

    lxplus> ./build -v -Qt
    lxplus> ./build -v -Python

In principle, you can also build the gtk, OpenMotif drivers that do not need a customization in the build system :

    lxplus> ./build -v -gtk
    lxplus> ./build -v -Xt

(On Linux, gtk being the default GUI, we advise to have that at hand. For OpenMotif, we let you judge...)

If all proceed well, then you can "build the release" :

    lxplus> ./build -release

It will build a binary zip file :

    ./osc/osc_vis/mgr/bin_gnu/distrib/osc_vis-17.0-<platform>.zip

Install

Assuming an lcg/external installation for the "config" x86_64-slc6-gcc46-opt, and then with the same installation path convention than other lcg externals :

    lxplus> mkdir -p /afs/cern.ch/sw/lcg/external/osc_vis/17.0/x86_64-slc6-gcc46-opt
    lxplus> cd /afs/cern.ch/sw/lcg/external/osc_vis/17.0/x86_64-slc6-gcc46-opt
    lxplus> <unzip -q the binary zip file> 

As the "unzip -q" put material under an osc_vis/17.0 directory you have to move things :

    lxplus> mv ./osc_vis/17.0/* .
    lxplus> rm -R -f ./osc_vis

Now you have to customize the installation so that the setup scripts work straight for a user :

    lxplus> ./install

This enforces the installation path in the [aida-]setup.[sh,csh] scripts.

But since the g++, Python and Qt used are not the one of the system, you have also to customize the access to them for a user :

     lxplus> cp $BUILD_PATH/gcc_setup.csh .
     lxplus> cp $BUILD_PATH/gcc_setup.sh .
     lxplus> cp $BUILD_PATH/py-setup.csh .
     lxplus> cp $BUILD_PATH/py-setup.sh .
     lxplus> cp $BUILD_PATH/Qt-setup.csh .
     lxplus> cp $BUILD_PATH/Qt-setup.sh .
     lxplus> cp $BUILD_PATH/all-setup.csh .
     lxplus> cp $BUILD_PATH/all-setup.sh .

Edit and customize :

     lxplus> cp $BUILD_PATH/gcc_setup.csh .
     lxplus> cp $BUILD_PATH/gcc_setup.sh .
     lxplus> cp $BUILD_PATH/py-setup.csh .
     lxplus> cp $BUILD_PATH/py-setup.sh .
     lxplus> cp $BUILD_PATH/Qt-setup.csh .
     lxplus> cp $BUILD_PATH/Qt-setup.sh .

to enforce the paths used to build the release.

Have a try

Create a breand new shell as if you were a user, for example a sh flavoured one. Then :

     lxplus6> . /afs/cern.ch/sw/lcg/external/osc_vis/17.0/x86_64-slc6-gcc46-opt/all-setup.sh

You can test Qt and the graphics with :

     lxplus6> osc-plot -Qt
   osc-plot> Help > Examples > Examples/AIDA/DLD > Analysis over analysis.root

If it is ok, then it will be ok for the Qt GUI and graphics of LHCb/Panoramix.

To test Python :

          sh> export OSC_GUI_TOOLKIT=Qt
     lxplus6> python $OSC_HOME_DIR/Resources/AIDA/examples/Python/aida_0.py 

Voila !