Appearance
Installation
Prerequisites
A Fortran 2003+ compliant compiler is required. GNU gfortran ≥ 9.2.0 and Intel Fortran ≥ 19.0.4 are known to work.
Download
StringiFor uses git submodules for its dependencies. Clone recursively:
bash
git clone https://github.com/szaghi/StringiFor
cd StringiFor
git submodule update --initThird-Party Dependencies
The submodules live under src/third_party/:
| Library | Purpose |
|---|---|
| PENF | Portable numeric kind parameters (I1P–I8P, R4P–R16P) and number-to-string conversion |
| FACE | ANSI terminal color/style support (used by string%colorize) |
| BeFoR64 | Base64 encode/decode (used by string%encode/string%decode) |
Build with fpm (recommended for new projects)
Fortran Package Manager resolves dependencies automatically. Add to your project's fpm.toml:
toml
[dependencies]
StringiFor.git = "https://github.com/szaghi/StringiFor"To build StringiFor itself and run its tests:
bash
fpm build
fpm testBuild with FoBiS (primary development tool)
FoBiS is the officially supported build system for development.
bash
pip install FoBiS.pyBuild all tests
bash
FoBiS.py buildCompiled test executables are placed in ./exe/.
Build the library
bash
# Static library (GNU gfortran)
FoBiS.py build -mode stringifor-static-gnu
# Shared library (GNU gfortran)
FoBiS.py build -mode stringifor-shared-gnu
# Static library (Intel Fortran)
FoBiS.py build -mode stringifor-static-intel
# Shared library (Intel Fortran)
FoBiS.py build -mode stringifor-shared-intelThe library is placed in ./lib/ (libstringifor.a or libstringifor.so).
Debug builds
bash
FoBiS.py build -mode tests-gnu-debug
FoBiS.py build -mode tests-intel-debugList all modes
bash
FoBiS.py build -lmodesBuild with GNU Make
A makefile is provided for static library builds:
bash
# Build static library with GNU gfortran (./lib/libstringifor.a)
make
# Build the tests suite
make TESTS=yes
# Use Intel Fortran instead
make COMPILER=intel
make COMPILER=intel TESTS=yesRunning the Test Suite
After a FoBiS or Make build that includes tests:
bash
bash scripts/run_tests.shEach executable in ./exe/ is run and its output checked for pass/fail.