Install multiple MPI libraries and switch between them on Ubuntu
0
votes
1
answer
1805
views
For educational purposes I'd like to set up several MPI libraries, e.g. OpenMPI, MPICH, and Intel MPI along with different backend compilers (gcc, clang, icc) on the same machine running Ubuntu 18.04.4 TLS. What is the best way to do this so as to be able to switch between them easily when I need to see how a particular code works with one MPI library/compiler or another?
So far I only managed to select a compiler via mpicc's
-cc
command line argument (MPICH) or OMPI_CC
environment variable (OpenMPI). But when I install OpenMPI after MPICH, for example, mpicc from MPICH seems to be getting replaced with the one from OpenMPI and I am basically losing access to MPICH:
$ sudo apt install mpich
$ mpicc -show
gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -I/usr/include/mpich -L/usr/lib/x86_64-linux-gnu -lmpich
$ sudo apt install libopenmpi-dev
$ mpicc -show
gcc -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -I/usr/lib/x86_64-linux-gnu/openmpi/include -pthread -L/usr//lib -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi
Is it possible to have both and choose which one I currently want to use?
Asked by mentalmushroom
(103 rep)
Jul 29, 2020, 07:01 AM
Last activity: Jul 29, 2020, 07:16 AM
Last activity: Jul 29, 2020, 07:16 AM