Discussion:
[OMPI users] Using Open MPI with multiple versions of GCC and G++
Aditya
2016-10-06 13:56:15 UTC
Permalink
Hello,

I'm a senior year Computer Science student working on Parallel Clustering
Algorithms at BITS Pilani, India. I have a few questions about using mpicc
and mpicxx with multiple versions of gcc / g++.

I am using Ubuntu 12.04 equipped with gcc 4.6.4. The currently installed
mpicc is bound to gcc4.6.4. I want mpicc to be bound with gcc-5 that I have
installed in my pc.

Is there a way to do the binding to gcc as a compiler flag or something of
that sort.

PS: Please do reply if you have a solution. I am unable to run a hybrid
code on my pc because of this issue.


Regards,
Aditya.
Jeff Squyres (jsquyres)
2016-10-06 14:12:23 UTC
Permalink
I'm a senior year Computer Science student working on Parallel Clustering Algorithms at BITS Pilani, India. I have a few questions about using mpicc and mpicxx with multiple versions of gcc / g++.
I am using Ubuntu 12.04 equipped with gcc 4.6.4. The currently installed mpicc is bound to gcc4.6.4. I want mpicc to be bound with gcc-5 that I have installed in my pc.
Is there a way to do the binding to gcc as a compiler flag or something of that sort.
PS: Please do reply if you have a solution. I am unable to run a hybrid code on my pc because of this issue.
Especially with C++, the Open MPI team strongly recommends you building Open MPI with the target versions of the compilers that you want to use. Unexpected things can happen when you start mixing versions of compilers (particularly across major versions of a compiler). To be clear: compilers are *supposed* to be compatible across multiple versions (i.e., compile a library with one version of the compiler, and then use that library with an application compiled by a different version of the compiler), but a) there's other issues, such as C++ ABI issues and other run-time bootstrapping that can complicate things, and b) bugs in forward and backward compatibility happen.

The short answer is in this FAQ item: https://www.open-mpi.org/faq/?category=mpi-apps#override-wrappers-after-v1.0. Substituting the gcc 5 compiler may work just fine.

But the *safer* answer is that you might want to re-build Open MPI with the specific target compiler.
--
Jeff Squyres
***@cisco.com
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/
Dave Love
2016-10-11 15:23:09 UTC
Permalink
Post by Jeff Squyres (jsquyres)
Especially with C++, the Open MPI team strongly recommends you
building Open MPI with the target versions of the compilers that you
want to use. Unexpected things can happen when you start mixing
versions of compilers (particularly across major versions of a
compiler). To be clear: compilers are *supposed* to be compatible
across multiple versions (i.e., compile a library with one version of
the compiler, and then use that library with an application compiled
by a different version of the compiler), but a) there's other issues,
such as C++ ABI issues and other run-time bootstrapping that can
complicate things, and b) bugs in forward and backward compatibility
happen.
Is that actually observed in GNU/Linux systems? I'd expect it either to
work or just fail to link. For instance, the RHEL 6 devtoolset-4 (gcc
5) uses the system libstdc++, and the system compiler is gcc 4.4.
Post by Jeff Squyres (jsquyres)
https://www.open-mpi.org/faq/?category=mpi-apps#override-wrappers-after-v1.0.
Substituting the gcc 5 compiler may work just fine.
For what it's worth, not for GNU Fortran, which unfortunately changes
the module format incompatibly with each release, or at least most
releases.
Gilles Gouaillardet
2016-10-11 23:49:31 UTC
Permalink
FWIW.


mpicxx does two things :

1) use the C++ compiler (e.g. g++)

2) if Open MPI was configured with (deprecated) C++ bindings (e.g.
--enable-mpi-cxx), then link with

the Open MPI C++ library that contains bindings.


IIRC, Open MPI v1.10 does build C++ bindings by default, but v2.0 does
not any more.

So if you are *not* using Open MPI C++ bindings (for example, you use C
bindings only,

or you use a third party lib such as BoostMPI), then you should not be
worried about

compatibility between C++ versions.


Cheers,


Gilles
Post by Dave Love
Post by Jeff Squyres (jsquyres)
Especially with C++, the Open MPI team strongly recommends you
building Open MPI with the target versions of the compilers that you
want to use. Unexpected things can happen when you start mixing
versions of compilers (particularly across major versions of a
compiler). To be clear: compilers are *supposed* to be compatible
across multiple versions (i.e., compile a library with one version of
the compiler, and then use that library with an application compiled
by a different version of the compiler), but a) there's other issues,
such as C++ ABI issues and other run-time bootstrapping that can
complicate things, and b) bugs in forward and backward compatibility
happen.
Is that actually observed in GNU/Linux systems? I'd expect it either to
work or just fail to link. For instance, the RHEL 6 devtoolset-4 (gcc
5) uses the system libstdc++, and the system compiler is gcc 4.4.
Post by Jeff Squyres (jsquyres)
https://www.open-mpi.org/faq/?category=mpi-apps#override-wrappers-after-v1.0.
Substituting the gcc 5 compiler may work just fine.
For what it's worth, not for GNU Fortran, which unfortunately changes
the module format incompatibly with each release, or at least most
releases.
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
Simon Hammond
2016-10-06 14:15:28 UTC
Permalink
Can you try setting the environment variable OMPI_CXX=<put the path to gcc-5 here>

Then run:

mpicxx -v

and see what version it says its running. You may have to be careful mixing the versions too far apart.


S.


Si Hammond
Scalable Computer Architectures
Center for Computing Research
Sandia National Laboratories, NM, USA
Post by Aditya
Hello,
I'm a senior year Computer Science student working on Parallel Clustering Algorithms at BITS Pilani, India. I have a few questions about using mpicc and mpicxx with multiple versions of gcc / g++.
I am using Ubuntu 12.04 equipped with gcc 4.6.4. The currently installed mpicc is bound to gcc4.6.4. I want mpicc to be bound with gcc-5 that I have installed in my pc.
Is there a way to do the binding to gcc as a compiler flag or something of that sort.
PS: Please do reply if you have a solution. I am unable to run a hybrid code on my pc because of this issue.
Regards,
Aditya.
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
Loading...