Skip to content

Installation

Prerequisites

A Fortran 2003+ compliant compiler is required. The following compilers are known to work:

CompilerMinimum 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

MORTIF uses git submodules for its third-party dependencies. Clone recursively:

bash
git clone https://github.com/szaghi/MORTIF --recursive
cd MORTIF

If you already have a non-recursive clone:

bash
git submodule update --init --recursive

Third-Party Dependencies

The submodules live under src/third_party/:

LibraryPurpose
PENFPortable numeric kind parameters (I4P, I8P, R4P, etc.)
fortran_testerLightweight assertion framework used in tests

FoBiS.py is the primary build system and is used by the CI pipeline.

bash
pip install FoBiS.py

List all build modes

bash
FoBiS.py build -lmodes

Available modes:

ModeDescription
tests-gnuBuild all tests with gfortran (release)
tests-gnu-debugBuild all tests with gfortran (debug)
tests-intelBuild all tests with ifort (release)
tests-intel-debugBuild all tests with ifort (debug)
static-gnuStatic library with gfortran → ./static/libmortif.a
shared-gnuShared library with gfortran → ./shared/libmortif.so
static-intelStatic library with ifort
shared-intelShared library with ifort

Build and run tests

bash
FoBiS.py build -mode tests-gnu
./scripts/run_tests.sh

Compiled 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-intel

Coverage and documentation

bash
FoBiS.py rule -ex makecoverage   # build + run tests + gcov report
FoBiS.py rule -ex makedoc        # build ford API documentation

Documentation 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 1

To build only the static library:

bash
make -j 1 STATIC=yes

Build 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