Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] ifort and gfortran module
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2009-07-22 13:37:14


Yep, that works.

I'm glad that our txt files and "look at argv[0]" scheme was useful in
the real world! (we designed it with uses almost exactly like this in
mind)

On Jul 20, 2009, at 1:47 PM, Martin Siegert wrote:

> 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
>
> The reason we use gfortran in step 1 is that otherwise you get those
> irritating error messages from the Intel libraries, cf.
> http://www.open-mpi.org/faq/?category=building#intel-compiler-wrapper-compiler-warnings
>
> Cheers,
> Martin
>
> --
> Martin Siegert
> Head, Research Computing
> WestGrid Site Lead
> IT Services phone: 778 782-4691
> Simon Fraser University fax: 778 782-4242
> Burnaby, British Columbia email: siegert_at_[hidden]
> Canada V5A 1S6
>
> On Sat, Jul 18, 2009 at 10:03:50AM +0330, rahmani wrote:
> > Hi,
> > you should compile openmpi with each pf intel and gfortran
> seperatly and install each of them in a separate location, and use
> mpi-selector to select one.
> > if don't use mpi selector, use full path of the compiler (for
> example /usr/local/openmpi/intel/bin/mpif90) and add the
> corresponding library to your LD_LIBRARY_PATH
> > Mahdi Rahmani
> >
> > ----- Original Message -----
> > From: "Jim Kress" <jimkress_58_at_[hidden]>
> > To: "Open MPI Users" <users_at_[hidden]>
> > Sent: Saturday, July 18, 2009 5:43:20 AM (GMT+0330) Asia/Tehran
> > Subject: Re: [OMPI users] ifort and gfortran module
> >
> > Why not generate an ifort version with a prefix of <directory you
> want for
> > openmpi>_intel
> > And the gfortran version with a prefix of <directory you want for
> > openmpi>_gcc
> >
> > ?
> >
> > That's what I do and then use mpi-selector to switch between
> versions as
> > required.
> >
> > Jim
> >
> > -----Original Message-----
> > From: users-bounces_at_[hidden] [mailto:users-bounces_at_open-
> mpi.org] On
> > Behalf Of Martin Siegert
> > Sent: Friday, July 17, 2009 3:29 PM
> > To: Open MPI Users
> > Subject: [OMPI users] ifort and gfortran module
> >
> > Hi,
> >
> > I am wondering whether it is possible to support both the Intel
> > compiler ifort and gfortran within a single compiled version of
> > openmpi.
> > E.g.,
> > 1. compile openmpi ifort as the Fortran compiler and install it
> > in /usr/local/openmpi-1.3.3
> > 2. compile openmpi using gfortran, but do not install it; only
> > copy mpi.mod to /usr/local/openmpi-1.3.3/include/gfortran
> >
> > Is there a way to cause mpif90 to include
> > /usr/local/openmpi-1.3.3/include/gfortran
> > before including /usr/local/openmpi-1.3.3/include if OMPI_FC is
> > set to gfortran (more precisely if `basename $OMPI_FC` = gfortran)?
> >
> > Or is there another way of accomplishing this?
> >
> > Cheers,
> > Martin
> >
> > --
> > Martin Siegert
> > Head, Research Computing
> > WestGrid Site Lead
> > IT Services phone: 778 782-4691
> > Simon Fraser University fax: 778 782-4242
> > Burnaby, British Columbia email: siegert_at_[hidden]
> > Canada V5A 1S6
> > _______________________________________________
> > users mailing list
> > users_at_[hidden]
> > http://www.open-mpi.org/mailman/listinfo.cgi/users
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users
>

-- 
Jeff Squyres
jsquyres_at_[hidden]