OpenMPI using GNU, Intel oneAPI, or AMD AOCC compilers

Compile OpenMPI using GNU, Intel oneAPI, or AMD AOCC compilers

Compiled version: OpenMPI 5.0.0
(10/11/2023)
Contact: lebedmi2@cvut.cz
 
Tested PC:
  • Intel(R) Core(TM) i5-14600K 3.50 GHz
  • RTX 2060 SUPER
  • Kingston FURY 32GB KIT DDR5 6000MHz CL32 Renegade
  • WSL2 Ubuntu version: 22.04
OpenMPI compiled with GCC (standard compilation)

Download OpenMPI (use wget command or download from here https://www.open-mpi.org/software/ompi/v5.0/)

wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.0.tar.gz
tar xvzf openmpi-5.0.0.tar.gz
cd openmpi-5.0.0
mkdir build

Compile OpenMPI into the ‚build‘ folder:

./configure --prefix=$HOME/SOFTWARE/OpenMPI/openmpi-5.0.0/build
make all -j
make install -j

To use this version of OpenMPI, export the following (either for local use by copying into command line, or by setting it as default by writing into ~/.bashrc on the last two lines):

export PATH=/home/lebedmi2/SOFTWARE/OpenMPI/openmpi-5.0.0/build/bin:$PATH
export LD_LIBRARY_PATH=/home/lebedmi2/SOFTWARE/OpenMPI/openmpi-5.0.0/build/lib:$LD_LIBRARY_PATH
OpenMPI compiled with oneAPI (intel compilers)

Compile and activate Intel oneAPI Base Toolkit (see HERE):

source /opt/intel/oneapi/setvars.sh

 

Download OpenMPI (use wget command or download from here https://www.open-mpi.org/software/ompi/v5.0/) and compile:

wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.0.tar.gz
mkdir OpenMPI_Intel
tar xvzf openmpi-5.0.0.tar.gz -C OpenMPI_Intel
cd OpenMPI_Intel/openmpi-5.0.0
mkdir build

Compile OpenMPI into the ‚build‘ folder:

./configure CC=icx CXX=icpx FC=ifort F77=ifort OMPI_CC=icx OMPI_CXX=icpx OMPI_FC=ifort OMPI_F77=ifort --prefix=/home/lebedmi2/SOFTWARE/OpenMPI/openmpi_intel/openmpi-5.0.0/build
make install -j

Activate it (either write the following into the last line of bashrc for permanent activation or write it directly into the console for temporal activation):

export PATH=/home/lebedmi2/SOFTWARE/OpenMPI/OpenMPI_Intel/openmpi-5.0.0/build/bin:$PATH
export LD_LIBRARY_PATH=/home/lebedmi2/SOFTWARE/OpenMPI/OpenMPI_Intel/openmpi-5.0.0/build/lib:$LD_LIBRARY_PATH
OpenMPI compiled with AOCC (AMD compilers)

Compile and activate AOCC (see HERE):

source /home/lebedmi2/SOFTWARE/AOCC/setenv_AOCC.sh

Download OpenMPI (use wget command or download from here https://www.open-mpi.org/software/ompi/v5.0/) and compile:

wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.0.tar.gz
mkdir OpenMPI_AOCC
tar xvzf openmpi-5.0.0.tar.gz -C OpenMPI_AOCC
cd OpenMPI_AOCC/openmpi-5.0.0
mkdir build

Compile OpenMPI into the ‚build‘ folder:

./configure CC=clang CXX=clang++ FC=flang F77=flang OMPI_CC=clang OMPI_CXX=clang++ OMPI_FC=flang OMPI_F77=flang --prefix=/home/lebedmi2/SOFTWARE/OpenMPI/OpenMPI_AOCC/openmpi-5.0.0/build
make install -j

Activate it (either write the following into the last line of bashrc for permanent activation or write it directly into the console for temporally activation):

export PATH=/home/lebedmi2/SOFTWARE/OpenMPI/OpenMPI_AOCC/openmpi-5.0.0/build/bin:$PATH
export LD_LIBRARY_PATH=/home/lebedmi2/SOFTWARE/OpenMPI/OpenMPI_AOCC/openmpi-5.0.0/build/lib:$LD_LIBRARY_PATH

Note: On Native Ubuntu, I needed to solve the following error by:

 sudo apt install g++-12
checking if C and C++ are link compatible... no
**********************************************************************
* It appears that your C++ compiler is unable to link against object
* files created by your C compiler.  This generally indicates either
* a conflict between the options specified in CFLAGS and CXXFLAGS
* or a problem with the local compiler installation.  More
* information (including exactly what command was given to the
* compilers and what error resulted when the commands were executed) is
* available in the config.log file in this directory.
**********************************************************************
configure: error: C and C++ compilers are not link compatible.  Can not continue.