fclap, a Fortran command line argument parser.
This project is an effort to create a simple to use, modern library implementation of a command line argument parser for fortran projects.
This project aims to replicate the functionalities of the python Argparse module.
Important Note: This project is still under development so use with caution as it may break
To build fclap from the source code in this repository you need to have a Fortran compiler supporting Fortran 2008 and one of the supported build systems:
- meson version 0.57.2 or newer, with a build-system backend, i.e. ninja version 1.10 or newer
- cmake version 3.14 or newer, with a build-system backend, i.e. ninja version 1.10 or newer
- fpm version 0.3.0 or newer
fpm was used as the primary build system during development. CMake and meson support are availible but the functionality may be limited Currently, fclap support GCC 8 and newer or Intel 18 and newer.
Detailed installation instruction are available in the project documentation under the installation category.
Setup a build with
meson setup _buildYou can select the Fortran compiler by the FC environment variable.
To compile and run the projects testsuite use
meson test -C _build --print-errorlogsTo run the more extensive testing for the available parametrizations use
meson test -C _build --print-errorlogs --benchmarkIf the testsuites pass you can install with
meson configure _build --prefix=/path/to/install
meson install -C _buildThis might require administrator access depending on the chosen install prefix. For more details see the meson installation instructions.
The user documentation is available at readthedocs. Additionally, the doxygen generated API documentation is available here.
To build the user documentation locally we use sphinx, install the dependencies you can use the mamba package manager
mamba create -n fclap_docs python -y
mamba activate flacp_docsMake sure to be in the docs directory and continue with:
pip install -r requirements.txt
make htmlThe build files for the documentation can be found in the docs/build folder.
This is a volunteer open source projects and contributions are always welcome. Please, take a moment to read the contributing guidelines on how to get involved in fclap.
The MIT License (MIT)
Copyright (c) 2026 Christian Selzer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.