Genser instructions for Users

The original document can be found at our SVN repository.


============
INTRODUCTION
============

The LCGSoft package allows distribution/installations of external generator packages
identical to the official LCGCMT releases for supported platforms.

Please note that each LCGCMT release has its own set of supported platforms. The
list of LCG CMT Releases is avalaible here: http://lcgsoft.web.cern.ch/lcgsoft/

LCGsoft supports LCGCMT releases starting from 65.

Briefly speaking, LCGSoft perfoms the following actions:

1) take source external/generators tarballs from the AFS directories:

  /afs/cern.ch/sw/lcg/external/tarFiles/ - for externals;
  /afs/cern.ch/sw/lcg/external/tarFiles/MCGeneratorsTarFiles - for generators;

with the corresponding http access:

  service-spi.web.cern.ch/service-spi/external/tarFiles/
  service-spi.web.cern.ch/service-spi/external/tarFiles/MCGeneratorsTarFiles

2) untar source files and apply patches if needed:

The patches applied can be found in:

  https://svnweb.cern.ch/trac/lcgsoft/browser/trunk/lcgcmake/[package-type]/patches

where [package-type] is one of the following package types:
externals, projects, pyexternals, gridexternals or generators.

i.e. generators patches can be found in:

  https://svnweb.cern.ch/trac/lcgsoft/browser/trunk/lcgcmake/generators/patches

Each patch has a package version as a part of patch file name, it is applied only to this version.

3) then LCGSoft package executes a set of actions using the macro based on cmake LCGPackage_Add:
     Default actions, performed automatically:
       o add the log files to the install area 
       o add the sources to the install area
       o create a binary tarball
       o strip rpath from .so files    

  A typical set of directives for the generator package configuration and installation steps (first
impression that it is complicated but it is not) looks like this:


#---lhapdf6------------------------------------------------------------------------------------------
    LCGPackage_Add(
      lhapdf6
      URL ${gen_url}/LHAPDF-.tar.gz
      CONFIGURE_COMMAND ./configure
         --prefix=
         --with-boost=${Boost_home}
         --with-yaml-cpp=${yamlcpp_home}
         PYTHON=${Python_home}/bin/python
         CYTHON=${cython_home}/bin/cython
         PYTHONPATH=${cython_pythonpath}  CFLAGS=-O2 CXXFLAGS=-O2 FCFLAGS=-O2 LDFLAGS=-O2
      BUILD_COMMAND ${MAKE} all
      ${library_path}=${yamlcpp_home}/lib:$ENV{${library_path}} PYTHONPATH=${cython_pythonpath} 
      LIBRARY_PATH=${Python_home}/lib
      BUILD_IN_SOURCE 1
      INSTALL_COMMAND make install PYTHONPATH=${cython_pythonpath} LIBRARY_PATH=${Python_home}/lib
              COMMAND ${CMAKE_COMMAND} -DINSTALL_DIR= -P ${CMAKE_SOURCE_DIR}/cmake/scripts/StripLib.cmake
      DEPENDS Boost yamlcpp Python cython
    )

The URL and CONFIGURE_COMMAND directives are obligatory, others are optional.
The directive names are more or less self-explainatory. User can easily change them according
to his/her needs.


The LCGSoft package has a system of different level tests. The corresponding instructions are here:
https://svnweb.cern.ch/trac/lcgsoft/browser/trunk/lcgcmake/documentation/ctests.txt

=============================
Usage of LCGSoft CMake system
=============================

1) checkout LCGSoft code from svn:

    svn co svn+ssh://svn.cern.ch/reps/lcgsoft/trunk/lcgcmake

2) create working/build directory:
     
    mkdir lcgcmake-build
    cd lcgcmake-build

3) set proper gcc and fortran compilers: 
    on AFS one can run corresponding gcc enviromental scripts (from /afs/cern.ch/sw/lcg/external/gcc)

    source /afs/cern.ch/sw/lcg/external/gcc/4.8.0/x86_64-slc6-gcc48-opt/setup.sh

4) set path to cmake (version should be equal or greater 2.8):

    export PATH=/afs/cern.ch/sw/lcg/external/CMake/2.8.9/Linux-i386/bin:$PATH

5) configure of LCGSoft package:

    cmake [options] /path/to/LCGSoft/source

Available options of LCGSoft CMake are:
    LCG_SAFE_INSTALL    |      ON/OFF      | ensure that no overwites occurs at the installation area of packages;
    LCG_IGNORE          |                  | list of packages to be ignored from LCG_INSTALL_PREFIX (';' separated);
    LCG_INSTALL_PREFIX  |                  | existing LCG installation path prefix;
    LCG_TARBALL_INSTALL |      ON/OFF      | turn ON/OFF creation/installation of tarballs;
    VALIDATION          |      ON/OFF      | turn ON/OFF validation options for LCGSoft tests;
    PDFsets             |                  | name of PDF sets to be downloaded.
    CMAKE_BUILD_TYPE    |    'Release'     | choose the type of build.
                        |     'Debug'      |
                        |   'MinSizeRel'   |
                        | 'RelWithDebInfo' |

Each option should be passed to cmake by -D flag, e.g.:
    cmake \
     -DCMAKE_INSTALL_PREFIX="/tmp" \
     -DPDFsets=ct10 \
     -DLCG_INSTALL_PREFIX=”/afs/cern.ch/sw/lcg/external" \
     -DLCG_SAFE_INSTALL=ON \
     -DLCG_IGNORE=”pythia6;pythia8”
     -DLCG_TARBALL_INSTALL=OFF
     -DCMAKE_BUILD_TYPE:STRING=Release \
     -DVALIDATION=OFF \
     ../lcgcmake

6) build and install packages

    make [make options] [package1, package2, ...]
  
  List of available packages for selected LCG release is available by running 'make help'
or at https://svnweb.cern.ch/trac/lcgsoft/browser/trunk/lcgcmake/cmake/toolchain/heptools-<release>.cmake

================================
Customizing LCGSoft CMake system
================================
Users can modify some CMake files and fit LCGSoft CMake system to their needs.

  In cmake/toolchain/heptools-<release>.cmake package version and dependencies can be changed.
  CMake uses the lates defined package's version for linking with other packages.

You are here