TRIQS/mpi 1.3.0
C++ interface to MPI
Loading...
Searching...
No Matches
Installation

mpi is a header only library and installation is not necessary. However, it still supports the usual installation procedure using CMake.

If you want to skip the installation step, you can go directly to Integration in C++ projects to see how you can integrate mpi into your own C++ project.

Note: To guarantee reproducibility in scientific calculations, we strongly recommend the use of a stable release version.

Dependencies

The dependencies of mpi are as follows:

  • gcc version 12 or later OR clang version 15 or later OR IntelLLVM (icx) 2023.1.0 or later
  • CMake version 3.20 or later (for installation or integration into an existing project via CMake)
  • a working MPI implementation (openmpi and Intel MPI are tested)

Installation steps

  1. Download the source code of the latest stable version by cloning the TRIQS/mpi repository from GitHub:

    $ git clone https://github.com/TRIQS/mpi mpi.src
  2. Create and move to a new directory where you will compile the code:

    $ mkdir mpi.build && cd mpi.build
  3. In the build directory call cmake, including any additional custom CMake options (see below):

    $ cmake -DCMAKE_INSTALL_PREFIX=path_to_install_dir ../mpi.src

    Note that it is required to specify CMAKE_INSTALL_PREFIX, otherwise CMake will stop with an error.

  4. Compile the code, run the tests and install the application:

    $ make -j N
    $ make test
    $ make install

    Replace N with the number of cores you want to use to build the library.

Versions

To use a particular version, go into the directory with the sources, and look at all available versions:

$ cd mpi.src && git tag

Checkout the version of the code that you want:

$ git checkout 1.3.0

and follow steps 2 to 4 above to compile the code.

Custom CMake options

The compilation of mpi can be configured using CMake options

$ cmake ../mpi.src -DOPTION1=value1 -DOPTION2=value2 ...
Options Syntax
Specify an installation path -DCMAKE_INSTALL_PREFIX=path_to_install_dir
Build in Debugging Mode -DCMAKE_BUILD_TYPE=Debug
Disable testing (not recommended) -DBuild_Tests=OFF
Build the documentation -DBuild_Documentation=ON
Build benchmarks -DBuild_Benchs=ON