#!/bin/bash cd $SIMPATH/generators if [ ! -d lib ]; then mkdir lib fi if (not_there Pythia6 $SIMPATH/generators/lib/libPythia6.so); then untar Pythia6 pythia6.tar.gz cd pythia6 case "$arch" in linuxicc) if [ ! -e makePythia6.inuxicc ]; then cp makePythia6.linux makePythia6.linuxicc echo "*** Patching the Pythia6 Makefile to compile with intel compilers" | tee -a $logfile sed -e 's/g77/ifort/g' -i makePythia6.linuxicc sed -e 's/gcc/icc/g' -i makePythia6.linuxicc sed -e 's/-fno-second-underscore//g' -i makePythia6.linuxicc fi echo "*** Start Compilation .........." . makePythia6.linuxicc ;; linux) if [ "$FC" = "g77" ]; then . makePythia6.linux else if [ ! -e makePythia6.inuxgfortran ]; then cp makePythia6.linux makePythia6.linuxgfortran echo "*** Patching the Pythia6 Makefile to compile with gfortran" | tee -a $logfile sed -e 's/g77/gfortran/g' -i makePythia6.linuxgfortran fi echo "*** Start Compilation .........." . makePythia6.linuxgfortran fi ;; linuxx8664gcc) if [ "$FC" = "g77" ]; then . makePythia6.linuxx8664 else if [ ! -e makePythia6.inuxx8664gfortran ]; then cp makePythia6.linuxx8664 makePythia6.linuxx8664gfortran echo "*** Patching the Pythia6 Makefile to compile with gfortran" | tee -a $logfile sed -e 's/g77/gfortran/g' -i makePythia6.linuxx8664gfortran fi echo "*** Start Compilation .........." . makePythia6.linuxx8664gfortran fi ;; linuxx8664icc) if [ ! -e makePythia6.inuxx8664icc ]; then cp makePythia6.linuxx8664 makePythia6.linuxx8664icc echo "*** Patching the Pythia6 Makefile to compile with intel compilers" | tee -a $logfile mysed 'g77' 'ifort' makePythia6.linuxx8664icc mysed 'gcc' 'icc' makePythia6.linuxx8664icc mysed '-fno-second-underscore' '' makePythia6.linuxx8664icc fi if [ "$debug" = "yes" ]; then echo "*** Patching the Pythia6 Makefile to compile with debug options" | tee -a $logfile mysed '-m64' '-m64 -g -O0' makePythia6.linuxx8664icc fi echo "*** Start Compilation .........." . makePythia6.linuxx8664icc ;; macosx) if [ "$FC" = "g77" ]; then echo . makePythia6.macosxg77 else echo . makePythia6.macosx fi ;; macosx64) if [ ! -e makePythia6.macosx64 ]; then cp makePythia6.macosx makePythia6.macosx64 echo "*** Patching the Pythia6 Makefile to compile on 64bit Mac OS X" | tee -a $logfile mysed '^gcc' 'gcc -m64' makePythia6.macosx64 mysed '^gfortran' 'gfortran -m64' makePythia6.macosx64 mysed 'libgfortran.a' 'x86_64/libgfortran.a' makePythia6.macosx64 has_salsh_in_string fi echo "*** Start Compilation .........." . makePythia6.macosx64 ;; solarisCC5) mysed 'gcc' 'cc' makePythia6.solaris mysed '/opt/SUNWspro/bin/f77' 'f77' makePythia6.solaris yes . makePythia6.solaris ;; solarisgcc) mysed '/opt/SUNWspro/bin/f77' 'g77' makePythia6.solaris yes . makePythia6.solaris ;; *) echo "No Makefile for the setting arch $arch and $compiler" echo "Stop the script at this point" exit ;; esac cd ../lib ln -s ../pythia6/libPythia6.so libPythia6.so if [ "$platform" = "macosx" ]; then ln -s ../pythia6/libPythia6.dylib libPythia6.dylib fi check_all_libraries $SIMPATH/generators/lib check_success Pythia6 $SIMPATH/generators/lib/libPythia6.so check=$? fi if [ "$platform" = "macosx" ]; then export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$SIMPATH/generators/lib else export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SIMPATH/generators/lib fi cd $SIMPATH return 1