After working with Fortran for a little bit, I found the best tool
for automating the build process for Fortran is CMake
.
CMake
has a number of rich high-level features
that make build Fortran codes easier and more consistent.
I've seen builds that use pure Make
, which works well for
smaller projects, but quickly become confusing as the project grows.
This repo seeks to provide some concrete examples with as much explanation as possible to make it clear to a someone with a relatively small amount of experience with CMake.
- Simplest project I could concoct.
- Some subdirectories.
- More Nested subdirectories.
- More advance CMake constructs (?)
- Combination of Fortran and C (?)
- Referencing external projects with CMake (?)
These examples currently only have linux
syntax.
Each example with a have a build.sh
script that runs CMake
and creates a build directory.
I included some vscode
specific stuff because I find working with Fortran
to be really nice using the tool and figured others might benefit as well.
Extension Name | Developer Name |
---|---|
C/C++ | Microsoft |
CMake | twxs |
CMake Tools | Microsoft |
Modern Fortran | The Fortran Programming Language |
- Great website for everything to do with Fortran
https://github.com/SethMMorton/cmake_fortran_template
- I liked what was done in this project, but wanted to add more examples.