#!/bin/bash if [ "$platform" = "macosx" ]; then export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:$SIMPATH/tools/monalisa/lib else export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$SIMPATH/tools/monalisa/lib fi cd $SIMPATH/tools export ROOTSYS=$PWD/root if (not_there root $ROOTSYS/bin/root.exe); then # untar root $ROOTVERSION.source.tar.gz # mv root $ROOTVERSION # ln -s $ROOTVERSION root cd $ROOTSYS # cp ../configure . # cp ../root-config.in config if [ "$debug" = "yes" ]; then echo "*** Building ROOT with debug information" | tee -a $logfile export ROOTBUILD=debug fi if [ "$compiler" = "intel" -a "$icc_version" = "10" ]; then echo "*** Patching Makfiles.linuxicc " | tee -a $logfile cp ../Makefile.linuxicc config fi if [ "$build_for_grid" = "yes" ] then cp ../rootconfig_grid.sh rootconfig.sh echo "Copied rootconfig_grid.sh ......................" | tee -a $logfile else cp ../rootconfig.sh . echo "Copied rootconfig.sh ......................" | tee -a $logfile fi echo "Configure Root .........................................." | tee -a $logfile if [ "$platform" = "solaris" ]; then mysed "awk" "gawk" configure chmod a+x configure cp ../makelib.sh build/unix if [ "$compiler" = "gcc" ]; then cp ../Makefile.solarisgcc config if [ "$system" = "64bit" ]; then mysed '-fPIC' '-fPIC -m64' config/Makefile.solarisgcc mysed '$(EXTRA_LDFLAGS)' '$(EXTRA_LDFLAGS) -m64' config/Makefile.solarisgcc fi else cp ../Makefile.solarisCC5 config if [ "$system" = "64bit" ]; then mysed '-KPIC' '-KPIC -m64' config/Makefile.solarisCC5 mysed '$(EXTRA_LDFLAGS)' '$(EXTRA_LDFLAGS) -m64' config/Makefile.solarisCC5 fi fi fi #make distclean . rootconfig.sh #This workaround to run make in a loop is #needed because of problems with the intel compiler. #Due to some internal problems of icc (my interpretation) #there are crashes of the compilation process. After #restarting the make process the compilation passes the #problematic file and may crash at a differnt point. #If there are more than 10 crashes the script is stoped if [ "$compiler" = "intel" ]; then counter=0 until [ -e $ROOTSYS/bin/root.exe ]; do counter=$[$counter+1] touch run_$counter if [ $counter -gt 10 ]; then echo "There is a problem compiling root" | tee -a $logfile echo "This is the " $counter " try to compile" | tee -a $logfile echo "Stop the script now" | tee -a $logfile exit 1 fi $MAKE_command -j$number_of_processes done else $MAKE_command -j$number_of_processes fi $MAKE_command install check_all_libraries $ROOTSYS/lib check_success root $ROOTSYS/bin/root.exe check=$? export PATH=${ROOTSYS}/bin:${PATH} cd $ROOTSYS/etc/vmc if [ "$arch" = "linuxx8664icc" ]; then cp Makefile.linuxx8664gcc Makefile.linuxx8664icc mysed 'g++' 'icpc' Makefile.linuxx8664icc mysed 'g77' 'ifort' Makefile.linuxx8664icc mysed 'gcc' 'icc' Makefile.linuxx8664icc mysed 'SHLIB = -lg2c' '' Makefile.linuxx8664icc mysed '-fno-f2c -fPIC' '-fPIC' Makefile.linuxx8664icc fi if [ "$FC" = "gfortran" ]; then if [ "$arch" = "linuxx8664gcc" ]; then cp Makefile.linux Makefile.linuxx8664gcc mysed "OPT = -O2" "OPT =" Makefile.linuxx8664gcc mysed "-Woverloaded-virtual" "" Makefile.linuxx8664gcc mysed "-DCERNLIB_LINUX" "-DCERNLIB_LXIA64" Makefile.linuxx8664gcc elif [ "$arch" = "linuxia64gcc" ]; then cp Makefile.linux Makefile.linuxia64gcc mysed "OPT = -O2" "OPT =" Makefile.linuxia64gcc mysed "-Woverloaded-virtual" "" Makefile.linuxia64gcc mysed "-DCERNLIB_LINUX" "-DCERNLIB_LXIA64" Makefile.linuxia64gcc fi fi mysed "OPT = -O2" "OPT =" Makefile.$arch mysed "OPT = -g" "OPT = ${CXXFLAGS} -fPIC" Makefile.$arch if [ "$platform" = "macosx" ]; then export DYLD_LIBRARY_PATH=${ROOTSYS}/lib/:${DYLD_LIBRARY_PATH} else export LD_LIBRARY_PATH=${ROOTSYS}/lib/:${LD_LIBRARY_PATH} fi else export PATH=${ROOTSYS}/bin:${PATH} if [ "$platform" = "macosx" ]; then export DYLD_LIBRARY_PATH=${ROOTSYS}/lib/:${DYLD_LIBRARY_PATH} else export LD_LIBRARY_PATH=${ROOTSYS}/lib/:${LD_LIBRARY_PATH} fi fi cd $SIMPATH return 1