Fortran Package Manager

The Fortran Package Manager, or fpm, is a community-driven, open-source build tool and package manager for the Fortran language. fpm makes it easy for beginners to develop applications. It streamlines project setup by quickly and easily generating Fortran project templates, facilitating rapid prototyping.

It accommodates side-by-side builds for multiple configurations and various compilers, enhancing project flexibility. Developers can easily reuse dependencies and seamlessly integrate with version control, making collaboration straightforward. fpm smoothly integrates with Git, unit testing frameworks (test-drive), the standard Fortran library (stdlib), among other tools, ensuring code quality and version control.

Hosted on GitHub, fpm boasts a growing ecosystem of projects and libraries, and extends its functionality through plugins like the fpm-gdb debugger plugin. A recent public beta feature introduces local and online registries for dependency packages, enhancing package management capabilities. Notably, fpm goes beyond Fortran, as it can compile C and C++ projects. It also simplifies the process of updating project dependencies when updates become available.  fpm offers a practical, user-friendly approach to modern Fortran development and project management.

OpenMP and the Fortran Package Manager

One of the standout features of fpm is its support for parallel compilation using OpenMP, enabling faster build times.

For the same reasons that have led to employing OpenMP within fpm for parallel builds, the authors want to give all fpmusers access to OpenMP in the most frictionless way. As of fpm 0.9.0, OpenMP was included in a list of core dependencies, or “metapackages”. Metapackages are special dependencies that can be enabled by just specifying their name (and, in future releases, by selecting an appropriate version range), and are automatically handled by fpm. This functionality was added thanks to a pilot funding round of Germany, aimed at modernizing and strengthening the Fortran ecosystem in which the Fortran Package Manager is quickly becoming a core tool. To enable OpenMP, it is now enough to add it to the dependencies section of the fpm.toml manifest as:


fpm will then automatically add appropriate compiler-dependent flags to the build commands.

You will find an example on how to use OpenMP in fpm in a code that calculates the value of π by performing a numerical integration here.

With this core functionality completed, authors are now seeking ways to improve this functionality and look forward to receiving user feedback about the usage of metapackage syntax for OpenMP. If you have suggestions for enhancements, comments, or concerns, feel free to submit them to either the Fortran-Lang Discourse forum or to the appropriate GitHub repository pages.