Mac Research
Mac How To

Compiling MPI with f90 support on Snow Leopard

Good day friends,

I am trying to compile the latest stable iteration of MPI, downloadable from http://www.mcs.anl.gov/research/projects/mpich2/index.php, on my MacBook Pro that utilizes the Snow Leopard OS, 10.6.4. I have installed both gfortran and gcc, both obtained from http://hpc.sourceforge.net/

When I compile the MPI program, it does not do so with f90 support. I need it to has this feature for another program, DL_POLY 2.17, a molecular dynamics simulation program available for academic institutions. The makefile to compile the parallel executable calls for mpif90.

MPI with f90 Fix

OpenMPI installs without a hitch with f90 support on 10.6.4. I use the following with the Intel compilers (free Beta test of version 12 until December).

Download from:

http://www.open-mpi.org/software/ompi/v1.4/

Remove or rename the old pre-installed Mac OS X version in /usr/bin:
sudo mv /usr/bin/mpicc /usr/bin/mpicc.old
sudo mv /usr/bin/mpiexec /usr/bin/mpiexec.old
sudo mv /usr/bin/mpif90 /usr/bin/mpif90.old
sudo mv /usr/bin/mpic++ /usr/bin/mpic++.old
sudo mv /usr/bin/mpicxx /usr/bin/mpicxx.old
sudo mv /usr/bin/mpif77 /usr/bin/mpif77.old
sudo mv /usr/bin/mpirun /usr/bin/mpirun.old
sudo mv /usr/bin/ompi_info /usr/bin/ompi_info.old
sudo mv /usr/bin/opal_wrapper /usr/bin/opal_wrapper.old

sudo mkdir /opt/openmpi
cd openmpi-1.4.2
./configure CXX=icpc CC=icc F77=ifort F90=ifort FC=ifort –prefix=/opt/openmpi –enable-mpi-f77 –enable-mpi-f90 -enable-shared –disable-static –with-xgrid
make all
sudo make install

set path=($path /opt/openmpi/bin)
setenv DYLD_LIBRARY_PATH .: … :/opt/openmpi/lib
setenv LD_LIBRARY_PATH .: … :/opt/openmpi/lib
setenv MANPATH … :/opt/openmpi/share/man

Exit mobile version