How fortran-lang/stdlib works
Main Components
• Preprocessing and Meta-programming: The project uses “fypp” – a Python-based preprocessor – to generate Fortran source files from templates. Include a component representing the preprocessing stage (scripts in the “config” directory, such as fypp_deployment.py).
• Build Systems and Configurations: The project supports CMake and Fortran Package Manager (fpm) as build systems. Mark components for CMake (CMakeLists.txt files in various directories, configuration options, installation scripts) and for fpm (fpm.toml and related branches).
• Documentation and Specification: There’s a “doc” directory and README that provide the API documentation and specifications. This is crucial for understanding the library’s intended functionalities.
• Testing and Examples: The “test” and “example” directories hold a large set of test suites and sample applications demonstrating usage of individual modules (such as examples for arrays, math routines, IO, sorting, etc.). Represent these as components interacting with the main library.
• Continuous Integration & Project Infrastructure: The “.github” directory shows CI workflows and issue templates along with community guidelines (e.g., CONTRIBUTING, CODE_OF_CONDUCT) that help maintain quality and standards.
Relationships and Interactions
• Dependency Flow: Indicate that tests (in “test”) and examples (in “example”) depend on the compiled stdlib library from the “src” and “include” directories.
Architectural Patterns and Design Principles
• Modular Design: The source code is partitioned into clear functional modules (e.g., blas, lapack, io, math, etc.). Emphasize the modular architecture.
Relevant Technologies, Frameworks, and Libraries
• Fortran (with Fortran 2008/2018 compliance) as the primary language.
• fypp – the preprocessing tool used for meta-programming.
• CMake – the primary build system, along with its configuration in various CMakeLists.txt files.
• fpm (Fortran Package Manager) – an alternative build and dependency management system.
• GitHub Actions – represented by the CI workflows in “.github/workflows.”
• External dependencies (like BLAS and LAPACK libraries) optionally configure the build if certain macros are defined.