This is a short post describing how to install libmesh and the whole dependencies behind it from scratch on Mac OSX (Intel). With Libmesh we will install the following packages: OpenMPI (needed since the OSX built-in MPI does not have Fortran support), PETSc and Trilinos.
Install g77
OS X does not natively come with a Fortran compiler. I would just install the one provided on http://hpc.sourceforge.net/, which is a binary that can be extracted right into /usr/.
UPDATE: For Snow Leopard, the provided g77 does not work (it is only compiled for Leopard at the time of this writing). I had success, however, by simply using the provided gfortran Snow Leopard binary on the same website. gfortran should be backwards compatible to g77 (really?)
Install OpenMPI
There's no problem to install your own MPI compilation while leaving Apple's one alive. Just download OpenMPI from open-mpi.org, unpack and configure with a custom prefix in order not to overwrite Apple's MPI installation. For additional info, check the OSX section on the OpenMPI website.
Install PETSc
Get the PETSc sources, unpack it and change into the PETSc directory. There, first set the environment variables as follows:
export PETSC_DIR=/home/norbert/Code/petsc-2.3.3-p15 export PETSC_ARCH=macx
Then, configure with
config/configure.py --with-mpi=1 --prefix=/home/norbert/Code/petsc_x64_OSX
--download-f-blas-lapack=1 --download-superlu_dist=1 --download-spooles=1
--download-umfpack=1 --download-blacs=1 --download-scalapack=1 --with-debugging=1
COPTFLAGS='-O3' OPTFLAGS='-O3' --with-blas-lapack-lib="-framework vecLib"
This does not include the MUMPS solvers, since they need a Fortran 90 compiler, which I didn't want to install...
Compile using make and test it using make test. Finally, do a make install.
UPDATE: For Snow Leopard, I had problems with the Fortran compiler not being able to use the C compiled libraries (probably some binary incompatibilities by the fortran compiler provided from HPC. I simply disabled Fortran support in PETSC using --with-fc=0
Trilinos
Notes
If you want to use VTK in libmesh, make sure to add -lvtkFiltering to the linker command in your Makefile. Apparently, libmesh forgets to link against this library, which caused (for me, at least), undefined references to vtkFieldArray and similar.

