Hi Martin
in your following solution I have a question:
in step2. move the Fortran module to the directory ...
what is "Fortran module"
in step3. we don't need to install openmpi?
thanks


----- Original Message -----
From: "Martin Siegert" <sieg...@sfu.ca>
To: "Open MPI Users" <us...@open-mpi.org>
Sent: Monday, July 20, 2009 1:47:35 PM (GMT-0500) America/New_York
Subject: Re: [OMPI users] ifort and gfortran module

Hi,

I want to avoid separate MPI distributions since we compile many
MPI software packages. Having more than one MPI distribution
(at least) doubles the amount of work.

For now I came up with the following solution:

1. compile openmpi using gfortran as the Fortran compiler
   and install it in /usr/local/openmpi
2. move the Fortran module to the directory
   /usr/local/openmpi/include/gfortran. In that directory
   create softlinks to the files in /usr/local/openmpi/include.
3. compile openmpi using ifort and install the Fortran module in
   /usr/local/openmpi/include.
4. in /usr/local/openmpi/bin create softlinks mpif90.ifort
   and mpif90.gfortran pointing to opal_wrapper. Remove the
   mpif90 softlink.
5. Move /usr/local/openmpi/share/openmpi/mpif90-wrapper-data.txt
   to /usr/local/openmpi/share/openmpi/mpif90.ifort-wrapper-data.txt.
   Copy the file to
   /usr/local/openmpi/share/openmpi/mpif90.gfortran-wrapper-data.txt
   and change the line includedir=${includedir} to
   includedir=${includedir}/gfortran
6. Create a wrapper script /usr/local/openmpi/bin/mpif90:

#!/bin/bash
OMPI_WRAPPER_FC=`basename $OMPI_FC 2> /dev/null`
if [ "$OMPI_WRAPPER_FC" = 'gfortran' ]; then
   exec $0.gfortran "$@"
else
   exec $0.ifort "$@"
fi


Reply via email to