Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] Compiler Choice in openmpi
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2008-05-12 20:43:14

On May 11, 2008, at 12:00 AM, Wen Hao Wang wrote:

> 1. How can I change/set Fortran compiler used after installing
> openmpi?
> I installed openmpi-1.2.5-2 on RHEL5.2 Server with x86_32 arch. The
> rpm has been shipped RHEL images. I directly installed the rpms
> without compiling the source code. Now all mpi* compiler wrappers
> point to GNU compilers. I need change to use Intel compilers by
> default. How should I do? I caught one message about configuration
> files /etc/openmpi-mca-params.conf and $HOME/.openmpi/mca-
> params.conf. Not sure whether these two files can help. While I
> failed to find detailed explanation for them.

You really need to compile Open MPI from source for this;
unfortunately, there are several aspects of Open MPI that are tied to
the specific compiler chain that is used. Specifically: you *might*
be able to get away without re-compiling Open MPI, but I wouldn't
advise it.

You can download the OMPI source tarball from the main web site and
configure it with the following to specify the intel compiler suite:

     ./configure CC=icc CXX=icpc FC=ifort F77=ifort ...

You may want to list other configure options, such as --prefix, --
enable-mpirun-prefix-by-default, etc.
> 2. Can I use Intel compiler and GNU compiler together?
> I am not sure whether I can use two types of compiler to compile one
> program. For example, use GNU c/c++ compiler and Intel Fortran
> compiler together to compile my project.

Yes, there are cases where this works. But if possible, it's
generally easiest to simply use a single compiler toolset (e.g., all
Intel or all GNU). More specifically, unless you have a *need* to mix
the compilers, just use a single toolset.

Jeff Squyres
Cisco Systems