#!/bin/bash cd $SIMPATH/transport/ # Full output during compilation and linking to check for the # compile and link commands #export CPPVERBOSE=1 if (not_there Geant4-Source $SIMPATH/transport/geant4/source/CMakeLists.txt); then untar geant4 $GEANT4VERSION.tar.gz ln -s $GEANT4VERSION geant4 fi G4WORKDIR=$SIMPATH/transport/geant4/ if [ "$make_install" = "yes" ]; then install_prefix=$SIMPATH_INSTALL clhep_exe=$SIMPATH_INSTALL/bin/clhep-config else install_prefix=$G4WORKDIR clhep_exe=$SIMPATH/cern/clhep/bin/clhep-config fi checkfile=$install_prefix/lib/libG4physicslists.so if (not_there Geant4-lib $checkfile); then cd $G4WORKDIR if (not_there Geant4-build $G4WORKDIR/build); then mkdir build fi cd build if [ "$geant4_download_install_data_automatic" = "yes" ]; then install_data="-DGEANT4_INSTALL_DATA=ON" else install_data="" fi cmake -DCMAKE_INSTALL_PREFIX=$install_prefix -DCMAKE_INSTALL_LIBDIR=$install_prefix/lib \ -DGEANT4_USE_G3TOG4=ON -DGEANT4_BUILD_STORE_TRAJECTORY=OFF \ -DGEANT4_BUILD_VERBOSE_CODE=OFF $install_data ../ $MAKE_command -j$number_of_processes install # copy the env.sh script to the bin directorry mkdir -p $install_prefix/bin # cp $G4WORKDIR/env.sh $install_prefix/bin if [ "$platform" = "macosx" ]; then cd $install_prefix/lib create_links dylib so fi if [ "$geant4_download_install_data_automatic" = "yes" ]; then # create unique links which is independent of the Geant4 version if [ ! -L $install_prefix/share/Geant4 ]; then ln -s $install_prefix/share/$GEANT4VERSIONp $install_prefix/share/Geant4 fi fi . $install_prefix/share/$GEANT4VERSIONp/geant4make/geant4make.sh else . $install_prefix/share/$GEANT4VERSIONp/geant4make/geant4make.sh fi cd $SIMPATH return 1