Why should I use CMake?

To follow up on fpm and MPI, with fpm/#438 merged, it is now possible to compile fortran MPI projects in fpm if you’re using the Intel mpi compiler wrapper (mpiifort).

1) Add the following to your fpm.toml file:

[build]
external-modules = "mpi"  # (if using)

2) Compile with:

$ fpm build --compiler mpiifort

3) Run with:

$ fpm run [NAME] --compiler mpiifort --runner mpirun

This only works for mpiifort by virtue of the existing compiler detection logic, but MPI support in fpm isn’t official in that fpm currently remains ignorant of the fact you are compiling MPI (see fpm/#354).

2 Likes