The Mac (for at least OS X 10.4.{7,8} on the Intel) uses gcc 4.0.1 for the compiler. It comes installed with the C and C++ frontends. What it doesn't come with is fortran. The transition from gcc 3.x to gcc 4.x marked the end of an era, namely, the reign of g77. No longer will g77 be supported as part of the GCC compiler suite. In it's stead arose two Fortran95 alternatives: gfortran (older link) and g95. The gfortran project is part of the overall gnu compiler suite, while the g95 is an independent effort.
After much waffling and indecision I settled, for reasons I no
longer remember, on using gfortran. Being generally
lazyoverworked I have been grabbing the pre-built
version that I found on
http://hpc.sourceforge.net/.
I take the link labelled:
gfortran-intel-bin.tar.gz, which I unpack into
/usr/local. This is just the fortran component (i.e.
not the C or C++ compilers) and is based on gcc 4.2.0
(at least when last fetched on 2006-09-13),
but appears completely compatible with using the 4.0.1 compiler backend.
Because so many scripts and Makefiles expect to find g77
I put a symlink from $HOME/bin/g77 to
/usr/local/bin/gfortran and added $HOME/bin
to my PATH.
For users who access the internet through a proxy may need to modify the 'curl' commands in the script (for instance for RAL) from:
curl ...
to:
curl -x wwwcache.rl.ac.uk:8008 ...
Another problem area is CERNLIB's use of imake.
This is bundled with the X11 installation (which you'll
need for CERNLIB). But you'll need to put
/usr/X11R6/bin in your path.
A pre-built, using gcc 4.0.1 and gfortran 4.2.0 (20060805), version can be downloaded from here.
My (bash)setup function looks like:
setup_cern()
{
# clear existing version out of path
if [ "$CERN" != "" ] ; then
PATH=`dropit -p $PATH $CERN` ; export PATH
fi
export CERN=$HOME/Software/cernlib
export CERN_LEVEL=2005
cernalt=""
doecho=""
for i in $@ ; do
case $i in
echo) doecho="yes" ;;
*) cernalt=$i ;;
esac
done
if [ "$cernalt" != "" ] ; then cernalt=_${cernalt} ; fi
export CERN=${CERN}${cernalt}
export CERN_ROOT=${CERN}/${CERN_LEVEL}
export CVSCOSRC=${CERN_ROOT}/src
export CERN_DIR=${CERN_ROOT}
export CERNLIBS=${CERN_DIR}/lib
export CERNLIB=${CERN_DIR}/lib
export CRNLIB=${CERN_DIR}/lib
export GEANT_DIR=$CERN_DIR
# export PATH=${CERN_DIR}/bin:${PATH}
PATH=`dropit -sf -D -p $PATH ${CERN_DIR}/bin` ; export PATH
unset cernalt
if [ "$doecho" != "" ] ; then
echo CERN_DIR=$CERN_DIR
unset doecho
fi
}
The dropit script is shamelessly
stolen from UPS
| Contact: Robert Hatcher <rhatcher@fnal.gov> |