Skip to content

Installation

This page gives a compact setup path for DUNE beginners and users coming from other FEM/PDE frameworks. It focuses on what matters first and links to official detailed docs for advanced scenarios.

1. Choose an installation mode

Use this rule of thumb:

  • Want the fastest first contact without modifying DUNE sources? Use distribution packages.
  • Want full C++ development flexibility (custom modules, latest features)? Build from source.
  • Want mainly Python workflows? Use DUNE Python installation routes.

Official entry points:

2. Minimal prerequisites

This section lists the baseline tools for a source-based DUNE setup.

At minimum:

  • C++ compiler (GCC or Clang),
  • CMake (>= 3.16),
  • pkg-config,
  • git.

Optional dependencies (MPI, SuiteSparse, METIS, etc.) are detected automatically during CMake configure. Use the CMake summary to decide what else to install for your use case.

3. Tutorial quick setup

This is the recommended setup path for this tutorial.

From the repository root:

./setup-env.sh
source _env/activate.sh
dunecontrol all

What setup-env.sh does:

  • creates _env/,
  • clones core modules (dune-common, dune-geometry, dune-grid, dune-istl, dune-localfunctions),
  • writes or updates _env/debug.opts and _env/release.opts,
  • writes or updates _env/activate.sh and _env/deactivate.sh.

Activation exports:

  • DUNE_CONTROL_PATH (module search path for dunecontrol),
  • DUNE_OPTS_FILE (default options file, set to debug by default),
  • PATH (includes _env/dune-common/bin for dunecontrol, duneproject).

Switch to release mode:

source _env/activate.sh --release

Useful setup script options:

./setup-env.sh --help
./setup-env.sh --env-dir /path/to/env
./setup-env.sh --install dune-functions
./setup-env.sh --install dune-functions --with-suggestions
./setup-env.sh --remove dune-functions

If DUNE_ENV is set (for example after source <env>/activate.sh), then setup-env.sh --install ... and setup-env.sh --remove ... use that active environment by default. Use --env-dir to override it explicitly.

4. General source-based setup

Use this section if you prefer a manual setup without setup-env.sh.

If you do not want to use setup-env.sh, the minimal manual flow is:

  1. Create one directory containing all DUNE modules.
  2. Clone the core module repositories into it.
  3. Create an opts file with CMAKE_FLAGS and BUILDDIR.
  4. Run dune-common/bin/dunecontrol --opts=<your.opts> all.

This is the same model used in most DUNE module development workflows.

5. Where to go for details

For this tutorial, keep using the scripted _env setup unless you have a specific reason to deviate.

Summary and next steps

You now have both the tutorial setup path and the general manual setup model. Continue with First program and example build layout to compile and run your first example module.