Appearance
Installation
Prerequisites
A Fortran 2003+ compliant compiler is required. The following compilers are known to work:
| Compiler | Minimum version |
|---|---|
| GNU gfortran | ≥ 6.1 |
| Intel Fortran (ifort / ifx) | ≥ 16.x |
MORTIF is developed on GNU/Linux. Windows should work out of the box but is not officially tested.
Download
bash
git clone https://github.com/szaghi/MORTIF
cd MORTIFThird-Party Dependencies
MORTIF has one dependency: PENF, which provides portable numeric kind parameters (I4P, I8P, R4P, etc.).
The preferred way to fetch it is via FoBiS.py (the dependency is declared in fobos):
bash
FoBiS.py fetchAlternatively, initialise the git submodule directly:
bash
git submodule update --init src/third_party/PENFBuild with FoBiS.py (recommended)
FoBiS.py is the primary build system and is used by the CI pipeline.
bash
pip install FoBiS.pyList all build modes
bash
FoBiS.py build -lmodesAvailable modes:
| Mode | Description |
|---|---|
tests-gnu | Build all tests with gfortran (release) |
tests-gnu-debug | Build all tests with gfortran (debug) |
tests-intel | Build all tests with ifort (release) |
tests-intel-debug | Build all tests with ifort (debug) |
static-gnu | Static library with gfortran → ./static/libmortif.a |
shared-gnu | Shared library with gfortran → ./shared/libmortif.so |
static-intel | Static library with ifort |
shared-intel | Shared library with ifort |
Build and run tests
bash
FoBiS.py build -mode tests-gnu
./scripts/run_tests.shCompiled test executables are placed in ./exe/.
Build the library
bash
# Static library (GNU gfortran)
FoBiS.py build -mode static-gnu
# Shared library (GNU gfortran)
FoBiS.py build -mode shared-gnu
# Static library (Intel Fortran)
FoBiS.py build -mode static-intelCoverage and documentation
bash
FoBiS.py rule -ex makecoverage # build + run tests + gcov report
FoBiS.py rule -ex makedoc # build ford API documentationDocumentation generation requires ford (pip install ford) and graphviz.
Build with GNU Make
A makefile is provided for compatibility. It builds all tests with executables in ./exe/:
bash
make -j 1To build only the static library:
bash
make -j 1 STATIC=yesBuild with CMake
bash
git clone --recursive https://github.com/szaghi/MORTIF $YOUR_MORTIF_PATH
mkdir build && cd build
cmake $YOUR_MORTIF_PATH
cmake --build .To run the test suite with CMake:
bash
cmake -DMORTIF_ENABLE_TESTS=ON $YOUR_MORTIF_PATH
cmake --build .
ctest