Installation
FoXy builds with fpm, FoBiS or CMake. All you need is a Fortran 2008 compiler: gfortran 14 or newer, ifx 2025 or nvfortran 26 are tested.
fpm
Add FoXy to the dependencies of your fpm.toml; fpm fetches it, and its dependencies, when you build:
[dependencies]
FoXy = { git = "https://github.com/Fortran-FOSS-Programmers/FoXy" }FoBiS
FoBiS is the build tool of FoXy's development. Clone the repository and fetch the dependencies (declared in fobos, cloned into src/third_party/):
git clone https://github.com/Fortran-FOSS-Programmers/FoXy
cd FoXy
fobis fetchBuild the library, lib/libfoxy.a with its modules in lib/mod, and link your program to it:
fobis build --mode foxy-static-gnu
gfortran -I lib/mod my_program.f90 lib/libfoxy.a -o my_programThe library holds the dependencies too: one archive, one module directory.
To run the tests (each test is a program in src/tests, built in exe/):
fobis build --mode tests-gnu && bash scripts/run_tests.sh # also tests-gnu-debug
fobis build --mode tests-intel && bash scripts/run_tests.sh # ifx, also tests-intel-debug
fobis build --mode tests-nvidia && bash scripts/run_tests.sh # nvfortran, also tests-nvidia-debugfobis build --lmodes lists every mode.
CMake
CMake uses the dependencies in src/third_party/: fetch them first.
git clone https://github.com/Fortran-FOSS-Programmers/FoXy
cd FoXy
fobis fetch
cmake -S . -B build
cmake --build build
cmake --install buildCMake installs package config files: find_package(FoXy) finds it in your project.
Compilers
With your own flags:
- ifx: compile with
-heap-arrays; ifx puts large temporaries (e.g. the content of a big tag) on the stack, which overflows on large documents. - nvfortran: preprocess with
-Mpreprocessand define_NVF(-D_NVF), which turns on StringiFor's nvfortran workarounds.
Dependencies
| Library | Purpose |
|---|---|
| PENF | portable kinds (I1P…I8P, R4P, R8P), number to string |
| StringiFor | the string type used by the parser |
| BeFoR64 | base64, used by StringiFor |
| FACE | ANSI colours, used by StringiFor |
fobis fetch clones them at their default branches and records the revisions in src/third_party/fobos.lock; fobis fetch --update updates them.
Next: the tutorial.