libmpdata++ - a library of parallel MPDATA-based solvers for systems of generalised transport equations
C++ Python CMake Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
COPYING adding COPYING file Jul 7, 2014
CREDITS Merge branch 'master' into codacy-badge-4 Mar 1, 2018
libmpdata++-config.cmake set Release flags also for Intel compiler Feb 2, 2018

libmpdata++ - a library of parallel MPDATA-based solvers for systems of generalised transport equations

Codacy Badge

To get more information on libmpdata++, please check:

In short, libmpdata++ is a header-only C++ library. Compilation of programs that use libmpdata++ requires:

  • a C++11 compliant compiler (optionally with OpenMP support)
  • Blitz++ and Boost C++ libraries
  • HDF5 and gnuplot-iostream libraries (optional, depending on the type of output mechanism chosen)

During development of libmpdata++, we are continuously testing the code on Linux using GCC and LLVM/Clang as well as on OSX using Apple/Clang - these are considered the supported platforms.

Compilation and execution of the examples shipped with libmpdata++ is easiest done using CMake, and the following instructions assume you're using CMake. Some hints on CMake usage are included at the end of this file.

The .travis.yml file shipped with the library contains a complete set of commands needed to build and execute all tests programs shipped with libmpdata++ on fresh Ubuntu and OSX installations - it may contain useful information on obtaining the dependencies.

  1. To verify if all dependencies are met, please start with: $ cd libmpdata++ $ mkdir build $ cd build $ cmake .. $ cd ../..

The next two steps are optional test. Running the tests is highly recommended to verify if the library works correctly in your environment. Nevertheless, in principle you can skip to step four and install the library right away.

  1. To perform unit tests, please try: $ cd tests/unit $ mkdir build $ cd build $ cmake .. $ make $ make test $ cd ../../..

The unit tests should complete in a dozen of seconds.

  1. To reproduce all results from the GMD paper, please try: $ cd tests/paper_2015_GMD $ mkdir build $ cd build $ cmake .. $ make $ make test
    $ cd ../../..

This takes ca. 15 minutes on a quad-core laptop. The "make test" command performs simulations, checks the output against reference data (tests/paper_2015_GMD//refdata/) and plots all figures included in the paper. The subfolders of paper_2015_GMD correspond to consecutive chapters in the GMD paper. Some of the scripts run by "make test" require additional packages including Python, Python libraries (NumPy, SciPy, matplotlib) and Paraview.

  1. To install the library system-wide, please try: $ cd libmpdata++/build $ sudo make install

This will copy the libmpdata++ headers into the system include path (e.g. /usr/include/libmpdata++) and copy the libmpdata++-config.cmake file into the system share directory (e.g. /usr/share/libmpdata++) what will allow CMake users to do find_package(libmpdata++).

Some CMake hints:

  • to point CMake to a non-default C++ compiler (e.g. clang++): $ cmake .. -DCMAKE_CXX_COMPILER=clang++

  • to alter the installation prefix (e.g. /usr/ instead of /usr/local): $ cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr

  • to switch between debug and release (default) compilation modes (has to be done after compiler choice): $ cmake .. -DCMAKE_BUILD_TYPE=Debug $ cmake .. -DCMAKE_BUILD_TYPE=Release

  • two alternative ways of cleaning leftovers from a previous build (including CMake cache files): $ rm -rf build/CMakeCache.txt build/CMakeFiles $ rm -rf build; mkdir build

  • the output of commands executed by "make test" can be viewed with: $ less Testing/Temporary/LastTest.log