#!/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 # create unique links for the data directories which are # independent of the actual data versions if [ ! -L $install_prefix/share/Geant4/data/G4EMLOW ]; then ln -s $install_prefix/share/Geant4/data/${G4EMLOW_VERSION} $install_prefix/share/Geant4/data/G4EMLOW fi if [ ! -L $install_prefix/share/Geant4/data/G4NDL ]; then ln -s $install_prefix/share/Geant4/data/${G4NDL_VERSION} $install_prefix/share/Geant4/data/G4NDL fi if [ ! -L $install_prefix/share/Geant4/data/G4NEUTRONXS ]; then ln -s $install_prefix/share/Geant4/data/${G4NEUTRONXS_VERSION} $install_prefix/share/Geant4/data/G4NEUTRONXS fi if [ ! -L $install_prefix/share/Geant4/data/G4PII ]; then ln -s $install_prefix/share/Geant4/data/${G4PII_VERSION} $install_prefix/share/Geant4/data/G4PII fi if [ ! -L $install_prefix/share/Geant4/data/G4SAIDDATA ]; then ln -s $install_prefix/share/Geant4/data/${G4SAIDDATA_VERSION} $install_prefix/share/Geant4/data/G4SAIDDATA fi if [ ! -L $install_prefix/share/Geant4/data/PhotonEvaporation ]; then ln -s $install_prefix/share/Geant4/data/${PhotonEvaporation_VERSION} $install_prefix/share/Geant4/data/PhotonEvaporation fi if [ ! -L $install_prefix/share/Geant4/data/RadioactiveDecay ]; then ln -s $install_prefix/share/Geant4/data/${RadioactiveDecay_VERSION} $install_prefix/share/Geant4/data/RadioactiveDecay fi if [ ! -L $install_prefix/share/Geant4/data/RealSurface ]; then ln -s $install_prefix/share/Geant4/data/${RealSurface_VERSION} $install_prefix/share/Geant4/data/RealSurface fi fi . $install_prefix/share/$GEANT4VERSIONp/geant4make/geant4make.sh check_success geant4 $checkfile check=$? else . $install_prefix/share/$GEANT4VERSIONp/geant4make/geant4make.sh fi cd $SIMPATH return 1