Fix for running FairRoot External Packages on OS X Lion

PandaRoot depends on FairRoot (CERN’s ROOT with lots of other stuff (GEANT etc.)). But the External Package will not compile on OS X Lion. There’s an error when gfortran-compiling Pythia6.

Following tip from Mohammad helps.

Change the contents of fairsoft/generators/pythia6/makePythia6.macosx64 to
# /bin/sh

# Pythia6 compiled with gfortran on MacOS X >= 10.4

# Look for a fink installation
FINKDIR=`which fink 2>&1 | sed -ne “s//bin/fink//p”` macosx_minor=`sw_vers | sed -n ‘s/ProductVersion://p’ | cut -d . -f 2`

gfortran -m64 -c pythia*.f
gfortran -m64 -fno-second-underscore -c tpythia6_called_from_cc.F
echo ‘void MAIN__() {}’ > main.c
gcc -m64 -c main.c
gcc -m64 -c pythia6_common_address.c
rm -f libPythia6.dylib
gcc -m64 -dynamiclib -flat_namespace -single_module -undefined dynamic_lookup
 -install_name $HOME/pythia6/libPythia6.dylib -o libPythia6.dylib
 main.o tpythia6_called_from_cc.o pythia*.o
 `gfortran  -print-file-name=libgfortran.a`
ln -s libPythia6.dylib

rerun ./makePythia6.macosx64 and start again with the ./ procedure.

I also encountered some errors, probably due to my previous installations of ROOT.

With a small and the following lines FairRoot then finally will compile.

sudo mv /opt/local/lib/libXpm.dylib /opt/local/lib/libXpm.dylib.old
sudo mv /opt/local/lib/libXext.dylib /opt/local/lib/libXext.dylib.old
sudo mv /opt/local/lib/libX11.dylib /opt/local/lib/libX11.dylib.old
sudo mv /opt/local/lib/libXft.dylib /opt/local/lib/libXft.dylib.old

sudo mv /opt/local/lib/libXpm.a /opt/local/lib/libXpm.a.old
sudo mv /opt/local/lib/libXext.a /opt/local/lib/libXext.a.old
sudo mv /opt/local/lib/libX11.a /opt/local/lib/libX11.a.old
sudo mv /opt/local/lib/libXft.a /opt/local/lib/libXft.a.old