#!/bin/bash if [ "$make_install" = "yes" ]; then install_prefix=$SIMPATH_INSTALL ml_lib=$SIMPATH_INSTALL/lib libdir=$install_prefix/lib/root else install_prefix=$SIMPATH/tools/root ml_lib=$SIMPATH/tools/monalisa/lib export ROOTSYS=$install_prefix libdir=$install_prefix/lib fi checkfile=$install_prefix/bin/root.exe if [ "$platform" = "macosx" ]; then export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:$ml_lib else export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ml_lib fi cd $SIMPATH/tools if (not_there root $checkfile); then cd root # special patch for Fedora 16 on 32bit # This should go into root cat /etc/issue | grep "Fedora release 16 (Verne)" result=$? if [ "$result" = "0" ];then if [ "$system" = "32bit" ]; then echo "*** Applying patch needed for Fedora 16 32bit " | tee -a $logfile patch -p0 < ../root_fedora16_32bit.patch fi fi 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 # actualy one should check for mac os x 10.8 if [ "$platform" = "macosx" -a "$compiler" = "Clang" ]; then mysed 'DEBUGFLAGS = -g$(DWARF2)' 'DEBUGFLAGS =' config/Makefile.macosx64 mysed 'LDFLAGS = $(OPT) -m64 -mmacosx-version-min=$(MACOSXVERS)' 'LDFLAGS = -m64 -mmacosx-version-min=$(MACOSXVERS)' config/Makefile.macosx64 fi . 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 $checkfile ]; 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 if [ "$make_install" = "yes" ]; then $MAKE_command install -j$number_of_processes else $MAKE_command -j$number_of_processes fi done else if [ "$make_install" = "yes" ]; then $MAKE_command install -j$number_of_processes else $MAKE_command -j$number_of_processes fi fi cd $SIMPATH/tools/root/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 mysed '-fno-second-underscore' '' 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 cd $SIMPATH/tools/root $MAKE_command install check_all_libraries $install_prefix/lib check_success root $checkfile check=$? export PATH=${install_prefix}/bin:${PATH} if [ "$platform" = "macosx" ]; then export DYLD_LIBRARY_PATH=${libdir}:${DYLD_LIBRARY_PATH} else export LD_LIBRARY_PATH=${libdir}:${LD_LIBRARY_PATH} fi else export PATH=${install_prefix}/bin:${PATH} if [ "$platform" = "macosx" ]; then export DYLD_LIBRARY_PATH=${libdir}:${DYLD_LIBRARY_PATH} else export LD_LIBRARY_PATH=${libdir}:${LD_LIBRARY_PATH} fi fi cd $SIMPATH return 1