#!/bin/bash # # CBM package compilation script # m.al-turany@gsi.de, June 2006 # protopop@jlab.org, June 2006 # update of the script # include debug version and # intel compiler switches # f.uhlig@gsi.de, July 2007 # debug options on :set -xv # debug options off:set +xv # set +xv # unset ROOTSYS. If it is set this can make problems when compiling Geant3 unset ROOTSYS # define the logfile datum=$(date +%d%m%y_%H%M%S) logfile=$PWD/Install_$datum.log logfile_lib=$PWD/libraries_$datum.log echo "The build process for the external packages for the FairRoot Project was started at" $datum | tee -a $logfile source scripts/functions.sh # check if there was a parameter given to the script. # if yes then use some standard parameters and don't # show the menues. Else get some input interactively. if [ $# == "0" ]; then source scripts/menu.sh else if [ $1 = "automatic" ]; then compiler=gcc debug=yes optimize=no geant4_download_install_data_automatic=yes geant4_install_data_from_dir=no make_install=yes SIMPATH_INSTALL=$PWD/install elif [ $1 = "grid" ]; then compiler=gcc debug=no optimize=no geant4_download_install_data_automatic=no geant4_install_data_from_dir=yes make_install=yes SIMPATH_INSTALL=$PWD/install build_for_grid=yes else echo "Parameter given to the script is not known." echo "The only valid parameter up to now is automatic." echo "Stop execution at this point." exit 42 fi fi # check the architecture automatically source scripts/check_system.sh # set the compiler options according to architecture, compiler # debug and optimization options source scripts/set_compiler.sh echo "The following parameters are set." | tee -a $logfile echo "System : " $system | tee -a $logfile echo "C++ compiler : " $CXX | tee -a $logfile echo "C compiler : " $CC | tee -a $logfile echo "Fortran compiler : " $FC | tee -a $logfile echo "CXXFLAGS : " $CXXFLAGS | tee -a $logfile echo "CFLAGS : " $CFLAGS | tee -a $logfile echo "FFLAGS : " $FFLAGS | tee -a $logfile echo "Compiler : " $compiler | tee -a $logfile echo "Fortran compiler : " $FC echo "Debug : " $debug | tee -a $logfile echo "Optimization : " $optimize | tee -a $logfile echo "Platform : " $platform | tee -a $logfile echo "Architecture : " $arch | tee -a $logfile echo "G4System : " $geant4_system | tee -a $logfile echo "g4_data_files : " $geant4_data_files | tee -a $logfile echo "g4_get_data : " $geant4_get_data | tee -a $logfile echo "Number of parallel " | tee -a $logfile echo "processes for build : " $number_of_processes | tee -a $logfile if [ "$make_install" = "yes" ]; then echo "Installation Directory: " $SIMPATH_INSTALL | tee -a $logfile fi #exit 1 # Set our base directory export SIMPATH=$PWD export SIMPATH_INSTALL=$SIMPATH_INSTALL check=1 # set the versions of packages to be build source scripts/package_versions.sh # Now start compilations with checks ######################## CMake ################################ # This is only for safety reasons. If we find a machine where # cmake is not installed, we install cmake and add the path # to the environment variable PATH if [ "$check" = "1" ]; then source scripts/install_cmake.sh fi #################### Version Info file ####################### # Generate a file which contains the version info from SVN # This is for debugging reasons if someone has only the # installation directory if [ "$check" = "1" ]; then source scripts/install_version_info.sh fi ############ Google Test framework ############################### if [ "$check" = "1" ]; then source scripts/install_gtest.sh fi ############ GLPK library ############################### if [ "$check" = "1" ]; then source scripts/install_glpk.sh fi ############ GNU scientific library ############################### if [ "$check" = "1" ]; then source scripts/install_gsl.sh fi ############ Boost libraries ############################### if [ "$check" = "1" ]; then source scripts/install_boost.sh fi ############ MonaLisa & MonaLisa Client ############################### if [ "$check" = "1" ]; then source scripts/install_monalisa.sh fi ##################### Pythia 6 ############################################# if [ "$check" = "1" ]; then source scripts/install_pythia6.sh fi ##################### Pythia 8 ############################################# if [ "$check" = "1" ]; then source scripts/install_pythia8.sh fi ##################### GEANT 4 ############################################# if [ "$check" = "1" ]; then source scripts/install_geant4.sh fi ###################### GEANT 4 Data ######################################## if [ "$check" = "1" -a "$geant4_install_data_from_dir" = "yes" ]; then source scripts/install_geant4_data.sh fi ##################### ROOT ############################################# if [ "$check" = "1" ]; then source scripts/install_root.sh fi ##################### Pluto ############################################# if [ "$check" = "1" ]; then source scripts/install_pluto.sh fi ##################### Geant 3 VMC ############################################# if [ "$check" = "1" ]; then source scripts/install_geant3.sh fi ##################### VGM ############################################# if [ "$check" = "1" ]; then source scripts/install_vgm.sh fi ##################### Geant 4 VMC ############################################# if [ "$check" = "1" ]; then source scripts/install_geant4_vmc.sh fi if [ "$check" = "1" ]; then echo "*** End installation of external packages without Errors***" | tee -a $logfile echo "" if [ "$install_cmake" = "yes" ]; then echo "During the installation a new version of CMake has been installed in $SIMPATH_INSTALL/bin." echo "Please add thsi path to your environment variable PATH to use this new version of CMake." fi exit 0 else echo "*** End installation of external packages with Errors***" | tee -a $logfile exit 42 fi