Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] openmpi -cc=<compiler name> option
From: Uday Kumar Reddy B (udayreddy_at_[hidden])
Date: 2011-09-23 06:52:15

On Fri, Sep 23, 2011 at 2:39 AM, Gus Correa <gus_at_[hidden]> wrote:
> Jeff Squyres wrote:
>> On Sep 22, 2011, at 4:17 PM, Uday Kumar Reddy B wrote:
>>> Yes, but I can't find anything about -cc in openmpi's mpicc man page. So,
>>> -cc should either not be supported or work as per mpich's mpicc if you are
>>> wrapping around it.
>> mpicc has no way of knowing that an option is not supposed to work.  It
>> only knows about a small number of options that it can understand (e.g.,
>> --showme).  Any other command line tokens are passed through to the
>> underlying compiler.
>> More specifically: how is mpicc supposed to know that any given option was
>> intended for mpicc and not the underlying compiler, particularly the ones
>> that it doesn't support?
> Uday
> If you want to use icc (instead of gcc or whatever is under your OpenMPI),
> just download the OpenMPI tarball
> to say /home/uday/install/openmpi, untar it,
> and build it with icc [and I would guess, with icpc and ifort as well].
> Configure it with --prefix=/your/favorite/directory (e.g. something under
> your home directory, and pass the compiler names to it CC=icc,
> CXX=icpc, F77=ifort, FC=ifort.
> Use the prefix so as not to mix it
> with other MPI flavors that may be there.
> Building takes three steps: 1) configure; 2) make; 3) make install.
> Then set your PATH and LD_LIBRARY_PATH to point to the bin and lib
> subdirectories of /your/favorite/directory.
> In case of doubts, read the README file and the OpenMPI FAQ.
> You're good to go.
> That one will have icc under mpicc's hood, which I guess
> is what you want.
> It is that simple.

But that's not really the point - to re-install MPI from sources! One
would like to choose between compilers depending on what's on the
system, and also switch between them to experiment. And if I'm
packacging a software that makes use of mpicc for building, I wouldn't
want to check what kind of mpi a user has and customize cmdline flags;
so environment variables don't really help - they just add to the
complexity. The only portable solution is for all MPIs to support the
same set of options (in particular, the frequently-used ones). Is
there any fundamental difficulty in adding -cc to openmpi's mpicc to
start with? mpich, mvapich already support it; in addition, it is
standard to have a (-h/-help flag) to list usage options; again, mpich
and mvapich list these with -help/-h.

$ mpicc -help
Usage: mpicc [options] file....

Available mpicc options:
    -echo - Show exactly what this program is doing.
                    This option should normally not be used.
    -show - Show the commands that would be used without runnning them.
    -compile-info - Show how to compile a program.
    -link-info - Show how to link a program.
    -v - Version info of mpicc and its native compiler -i-dynamic.
    -help - Give this help message.
    -mpe=XXX - Build with MPE option, XXX.
                    See "mpicc -mpe=help" for more information.
    -profile=XXX - Use profiling configuration file,
                    As a special case, or may be used
                    if the library is in /usr/mpi/intel/mvapich2-1.4/lib.
    -config=XXX - Use configuration file, mpicc-XXX.conf.
    -cc=xxx - Reset the native compiler to xxx.

-- Uday

> My two cents,
> Gus Correa
> _______________________________________________
> users mailing list
> users_at_[hidden]