On a Mac you might get the following error:
$ mpif90 pisum1.f90
--------------------------------------------------------------------------
Unfortunately, this installation of Open MPI was not compiled with
Fortran 90 support. As such, the mpif90 compiler is non-functional.
--------------------------------------------------------------------------
This indicates that the Mac has a version of MPI, but not one that works with Fortran 90.
To fix this, see http://www.macresearch.org/compiling-mpi-f90-support-snow-leopard.
Kyle Mandli suggests the following modifications to what’s there:
All of the compilers in the flags are intel compilers, you need to switch them to the corresponding gcc compilers such as
CXX=g++ CC=gcc F77=gfortran F90=gfortran FC=gfortranalthough I would be surprised if the configure script does not figure this out for itself.
I might also suggest using a different prefix than /opt/openmpi (something more sensible would be /usr/local). If you use the /usr/local prefix you should not have to set all the paths.
The –with-xgrid flag is not installed by default with OpenMPI so you can skip that flag as well.