Installation.md 4.17 KB
Newer Older
Praetorius, Simon's avatar
Praetorius, Simon committed
1
2
3
4
5
Installation instructions
=========================
We provide a *cmake*-based configuration and use the `dunecontrol` build system.
Simply run

6
```
Praetorius, Simon's avatar
Praetorius, Simon committed
7
8
9
10
11
12
13
14
15
dunecontrol --current all
```

The `dunecontrol` script searches for the required
(and suggested) dune modules this library depends on. These include:
- [dune-common](https://gitlab.dune-project.org/core/dune-common)
- [dune-geometry](https://gitlab.dune-project.org/core/dune-geometry)
- [dune-grid](https://gitlab.dune-project.org/core/dune-grid)
- [dune-localfunctions](https://gitlab.dune-project.org/core/dune-localfunctions)
16
- [dune-istl](https://gitlab.dune-project.org/core/dune-istl)
Praetorius, Simon's avatar
Praetorius, Simon committed
17
18
19
20
21
22
23
24
- [dune-typetree](https://gitlab.dune-project.org/staging/dune-typetree)
- [dune-functions](https://gitlab.dune-project.org/staging/dune-functions)

(See the file `dune.module` for an up-to-date list of dependencies). The dune modules
can be obtained from https://gitlab.dune-project.org and need to be found in a
subdirectory of `DUNE_CONTROL_PATH`. See also https://dune-project.org/doc/installation
for details about the installation of dune modules.

25
Additionally the following optional libraries can be used:
Praetorius, Simon's avatar
Praetorius, Simon committed
26
- [MTL4](https://gitlab.math.tu-dresden.de/spraetor/mtl4) (use this fork to get up-to-date changes)
27
28
- [Eigen3](http://eigen.tuxfamily.org) >= 3.3
- [SuiteSparse](http://faculty.cse.tamu.edu/davis/suitesparse.html)
Praetorius, Simon's avatar
Praetorius, Simon committed
29
30
- libalberta >= 3.0 (For Alberta-Grids)

31
32
33
And a compiler that supports the C++14 standard, e.g. g++ >= 5.0 and clang >= 3.6, and cmake >= 3.1.

By default, the `dune-istl` linear-algebra backend is used. To choose one of `ISTL`, `MTL`, or `EIGEN`, you can specify the cmake parameter `-DBACKEND=[ISTL,MTL,EIGEN]`.
Praetorius, Simon's avatar
Praetorius, Simon committed
34
35
36
37
38
39

If your MTL4 installation is not found by default, you have to specify the path,
where the file `MTLConfig.cmake` is found, here called `MTL_ROOT`. Then simply use
`dunecontrol` to configure and `cmake` to build:

```
40
41
42
CMAKE_FLAGS="-DBACKEND=MTL -DMTL_DIR:PATH=[MTL_ROOT]" dunecontrol --current configure
cmake --build build-cmake
```
Praetorius, Simon's avatar
Praetorius, Simon committed
43
44
45

Install Dune modules
--------------------
46
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.0/)), or install everything from the repository:
Praetorius, Simon's avatar
Praetorius, Simon committed
47

Praetorius, Simon's avatar
Praetorius, Simon committed
48
```bash
Praetorius, Simon's avatar
Praetorius, Simon committed
49
50
51
52
53
cd ${SOURCE_DIR}
git clone https://gitlab.dune-project.org/core/dune-common.git
git clone https://gitlab.dune-project.org/core/dune-geometry.git
git clone https://gitlab.dune-project.org/core/dune-grid.git
git clone https://gitlab.dune-project.org/core/dune-localfunctions.git
54
git clone https://gitlab.dune-project.org/core/dune-istl.git
Praetorius, Simon's avatar
Praetorius, Simon committed
55
56
57
58
59
60
git clone https://gitlab.dune-project.org/staging/dune-typetree.git
git clone https://gitlab.dune-project.org/staging/dune-functions.git
```

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.

Praetorius, Simon's avatar
Praetorius, Simon committed
61
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 `dune.opts`
Praetorius, Simon's avatar
Praetorius, Simon committed
62
63
64
65
66
67
68
69
70
71
72

```bash
CMAKE_FLAGS="-DALBERTA_ROOT:PATH=${ALBERTA_ROOT} \
             -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}"
MAKE_FLAGS="-j4 install"
```

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:

Praetorius, Simon's avatar
Praetorius, Simon committed
73
```bash
Praetorius, Simon's avatar
Praetorius, Simon committed
74
75
76
77
78
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.