Debian packages

To generate Debian packages, make sure to set the following variables:

make -j $(nproc) package

The directory should now contain a .deb package and the corresponding checksum file. You can install this using your package manager (to be able to remove properly): sudo apt install ./libprecice2.2.0.deb

In case you want to remove this package, use your package manager: sudo apt purge libprecice2.2.0.

Static library

To build preCICE as a static library, you can set -DBUILD_SHARED_LIBS=OFF or simply omit the option.

This is not recommended or supported by the preCICE developers! You may contribute here (better support is coming soon).

Disabling native bindings

The library provides native bindings for C and Fortran. They are called native as they are compiled into the resulting library. If you know what you are doing, you can disable them by specifying -DPRECICE_ENABLE_C=OFF, or -DPRECICE_ENABLE_FORTRAN=OFF.

We highly discourage you to do this, as the resulting binaries will not be compatible with C or Fortran adapters!

Overriding dependencies



  • EIGEN3_INCLUDE_DIR being the root of the repository.




  • JSON_INCLUDE_DIR this expects the scoped include to work #include <nlohmann/json.hpp


  • PRETTYPRINT_INCLUDE_DIR this expects the scoped include to work #include <prettyprint/prettyprint.hpp


  • Environment variables PETSC_DIR and PETSC_ARCH.


  • PYTHON_LIBRARY, PYTHON_INCLUDE_DIR, NumPy_INCLUDE_DIR (the two latter are often identical)

MPI - Build preCICE using non-default MPI implementation

  • Set CXX to the compiler wrapper if you want to be sure that the right installation is picked.

For using a non-default MPI implementation one can steer the CMake MPI discovery by setting the variable MPI_CXX_COMPILER to the path to the mpicxx compiler wrapper shipped with your MPI distribution of choice.

Example - building with MPICH:

cmake -DBUILD_SHARED_LIBS=ON -DPRECICE_MPICommunication=ON -DMPI_CXX_COMPILER=/usr/bin/mpicxx.mpich ..