Introduction
February 19, 2026 · View on GitHub
fpm-modules
A fpm plugin to generate module dependency graph
Explore the project »
Introduction
About the Project
fpm-modules is a simple plugin for modern fortran to generate module dependency graphs.
Whether you inherited a large piece of code, want to document your code base or have plans to refactor some libraries, being able to visually navigate through the files, modules and dependencies is a must.
The present project has been created for doing just that. It has been designed to generate a dependency graph and visualize the dependencies between modules.
Check out the tutorial to know more about it!
Getting Started
Requirements
To build that library you need
- a Fortran compiler. The following compilers are tested on the default branch of fpm-modules:
| Name | Version | Platform | Architecture |
|---|---|---|---|
| GCC Fortran (MinGW) | 14 | Windows 10 | x86_64 |
| Intel oneAPI classic | 2021.5 | Windows 10 | x86_64 |
Usage
fpm-modules has few command lines that can be used:
- -d, --dir: The path to the directory where the fpm.toml file seats.
fpm modules -d "./"- -K, --layout: The layout library. Possible options are "dot" (default), "fdp", "sfdp", "neato", "json", "toml", "mermaid" and "force".
fpm modules -K "mermaid"- -x, --exclude: The list of excluded packages by name. Names are comma-separated, no spaces, no quotes.
fpm modules -x fpm,daglib- -o, --output: The path to the output file. By default, the standard output is used.
Here is a table summarizing the different options and combinations that can be used:
| -K | -o |
|---|---|
| (default: dot) | *.json, *.dot, *.gv, *.svg, *.jpg, *.png, *.html |
| dot, fdp, sfdp, neato | *.json, *.dot, *.gv, *.svg, *.jpg, *.png, *.html |
| circle | *.json, *.html |
| force | *.json, *.html |
| mermaid | *.mmd, *.html |
| json | *.json |
| toml | *.toml |
| markmap | *.html, *.md |
Installation
Get the code
git clone https://github.com/davidpfister/fpm-modules
cd fpm-modules
Build with fpm
The repo can be build using fpm
fpm build
Installation as fpm plugin
Since it is built with fpm it can easily be installed on your system with
git clone https://github.com/davidpfister/fpm-modules
cd fpm-modules
fpm install --profile release
This will install the fpm-modules binary to ~/.local/bin (or %APPDATA%\local\bin on Windows).
For more information about fpm plugins, visit the fpm website.
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. So, thank you for considering contributing to fpm-modules. Please review and follow these guidelines to make the contribution process simple and effective for all involved. In return, the developers will help address your problem, evaluate changes, and guide you through your pull requests.
License
Distributed under the MIT License.