CMAKE_FLAGS="-DMTL_DIR:PATH=[MTL_ROOT]" dunecontrol --current all
```
This compiles the library and all examples in the `src/` directory.
Install Dune modules
--------------------
To install all required Dune modules you can either install a debian package (Version 2.6 required), using source packages (e.g. [Version 2.6](https://dune-project.org/releases/2.6.0rc1/)), or install everything from the repository:
If additional grid types are required in the application (e.g. [AlbertaGrid](http://www.mathematik.uni-stuttgart.de/fak8/ians/lehrstuhl/nmh/downloads/alberta/), [dune-alugrid](https://gitlab.dune-project.org/extensions/dune-alugrid), or [dune-uggrid](https://gitlab.dune-project.org/staging/dune-uggrid). See also the list of dune modules on [dune-project.org](https://dune-project.org/groups/grid/)), these must be installed separately. Thereby, all Dune modules can be downloaded into the `${SOURCE_DIR}` folder. AlbertaGrid requires to set the cmake flag `-DALBERTA_ROOT` when configuring the dune-grid module.
To compile all Dune modules maybe some flags need to be given to cmake. When using the `dunecontrol` script this can be accomplished by providing an options file
```bash
cat> dune.opts <<-EOM
CMAKE_FLAGS="-DALBERTA_ROOT:PATH=${ALBERTA_ROOT}\
-DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}"
MAKE_FLAGS="-j4 install"
EOM
```
This specifies the location of the AlbertaGrid installation and an installation dir `${INSTALL_DIR}` for the Dune modules.
I prefer an out-of-source build and thus specify a common build directory for all Dune modules:
```
mkdir -p /tmp/dune/build
DUNE_CONTROL_PATH=${SOURCE_DIR} ${SOURCE_DIR}/dune-common/bin/dunecontrol --opts=dune.opts --builddir=/tmp/dune/build all
```
When the Dune modules are installed, the `bin/` directory in `${INSTALL_DIR}` can be added to the PATH variable to make `dunecontrol` and other scripts available directly.