Skip to content
Snippets Groups Projects
Praetorius, Simon's avatar
Praetorius, Simon authored
Remove argument from cmake command finalize_dune_project

See merge request !1
c2a1752b
History

How to Compile and Build the Examples?

General requirements:

  • C++ compiler supporting the C++17 language standard, e.g. g++ >= 7 or clang >= 5
  • CMake >= 3.13
  • SuiteSparse / UMFPack

Getting all Dune dependencies

The code depends on several dune modules, publicly available

And on the new dune modules introduced in the manuscript:

Download all modules in a common root directory, called DUNE_DIR, change to that directory and run the command dunecontrol to configure and build all dependencies:

./dune-common/bin/dunecontrol all

Compiling the Examples

Since the examples are also provided as dune module, the dunecontrol script can be used for the configuration and build process. Therefore, tell dunecontrol where to find all the other dune modules:

DUNE_CONTROL_PATH=${DUNE_DIR} ${DUNE_DIR}/dune-common/bin/dunecontrol --current all

Running the Examples

When build with cmake, all examples executables are placed in the directory build-cmake/src. Thus, in order to run an example with the suffix <suffix>, simply call

./build-cmake/src/example<suffix> [additional arguments...]

or use the provided run-script that just prefixes the <suffix> with the executable:

./run.sh <suffix> [additional arguments...]

Using Docker to build and run all examples

A Docker container is provided that allows to compile and run all the examples in this repository. To build the image, run in the current directory

docker build -t dune-curvedgrid-examples .

See also the Dockerfile for details what is build.

To run the example<suffix> code, simply execute the docker image with the corresponding <suffix>:

docker run --rm -it dune-curvedgrid-examples <suffix> [additional arguments...]

e.g.

docker run --rm -it dune-curvedgrid-examples 10 example10b.ini