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:
- https://www.dune-project.org/doc/gettingstarted/
- https://www.dune-project.org/installation/installation-deb/
- https://www.dune-project.org/installation/installation-buildsrc/
- https://www.dune-project.org/installation/installation-pip/
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.optsand_env/release.opts, - writes or updates
_env/activate.shand_env/deactivate.sh.
Activation exports:
DUNE_CONTROL_PATH(module search path fordunecontrol),DUNE_OPTS_FILE(default options file, set to debug by default),PATH(includes_env/dune-common/binfordunecontrol,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:
- Create one directory containing all DUNE modules.
- Clone the core module repositories into it.
- Create an opts file with
CMAKE_FLAGSandBUILDDIR. - 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¶
- External libraries and package discovery: https://www.dune-project.org/installation/external-libraries/
- Installation FAQ: https://www.dune-project.org/installation/installation-faq/
- Build system reference: https://www.dune-project.org/doc/buildsystem/
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.