Skip to content
Examples of modern Fortran 2008 submodule
Fortran CMake Meson
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
archive
cmake
src
.editorconfig
.gitignore
CITATION.txt
CMakeLists.txt
LICENSE.txt
README.md
meson.build
requirements.txt

README.md

Fortran Submodule

DOI Actions Status Actions Status

Examples of modern Fortran 2008 submodule, using Meson or CMake. Fortran submodules are a unique concept distinct from C++. Fortran submodules allow easy switching in and out of features and extremely fast recompilation of large programs perhaps 100 times or more faster. For example a program's file IO could use raw binary, HDF5, or NetCDF switched using Fortran submodule. A simulation could have different proprietary or open source modules switched in and out via Fortran submodule.

In general, Fortran compilers have good submodule support. This includes gfortran, Intel ifort, nagfor, flang, PGI, IBM, Cray, etc.

Build

Meson and CMake are two build systems that support Fortran submodule.

Meson

meson build

meson test -C build

CMake

CMake >= 3.12 is required to use Fortran submodule. NAG compiler requires CMake >= 3.16.3

cmake -B build

cmake --build build --parallel

cd build

ctest -V

Notes

You can’t perform that action at this time.