Commit 834e62b4 authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos
Browse files

Merge branch '197-simplify-cloning-dune-modules-and-executing-dunecontrol-script' into 'master'

Resolve "Simplify cloning DUNE modules and executing dunecontrol script"

Closes #197

See merge request !205
parents b275c191 42bd2e49
......@@ -115,8 +115,6 @@ prep:update-dune-clang:
script:
- docker build -f docker/dune-env-update.dockerfile
--build-arg DUNE_ENV_IMAGE=${DUNE_ENV_IMAGE}-clang
--build-arg CC=clang
--build-arg CXX=clang++
--build-arg PROCNUM=$CPUS_DIND
-t ${DUNE_ENV_IMAGE}-clang .
- docker push ${DUNE_ENV_IMAGE}-clang
......
......@@ -6,6 +6,7 @@
* Linerar solver for finite volumes changed from `AMG_4_DG` to
`BCGS_AMG_SSOR` !204
* Simplify installation instructions !205
## 2.0.0 (2020-05-14)
......
......@@ -15,6 +15,7 @@ in the User Manual to dive right in!
* [Overview](#overview)
* [Installation](#installation-instructions)
* [Docker Image](#download-docker-image)
* [Dependencies](#dependencies)
* [Manual Installation](#manual-installation)
* [Recommended Tools](#recommended-third-party-software)
* [Documentation](#documentation)
......@@ -84,6 +85,62 @@ You can then proceed directly to the the instructions on
to the usual commands for running a Docker container. See the description on
Docker Hub for further details.
### Dependencies
Depending on your system configuration, there will be more packages necessary to
install DORiE on your machine. See the step-by-step manual for further details.
The specified versions are the _supported_ ones, where compatibility is ensured
by CI tests.
#### DUNE Packages
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| [dune-common](https://gitlab.dune-project.org/core/dune-common) | releases/2.6
| [dune-geometry](https://gitlab.dune-project.org/core/dune-geometry) | releases/2.6
| [dune-grid](https://gitlab.dune-project.org/core/dune-grid) | releases/2.6
| [dune-uggrid](https://gitlab.dune-project.org/staging/dune-uggrid) | releases/2.6
| [dune-istl](https://gitlab.dune-project.org/core/dune-istl) | releases/2.6
| [dune-localfunctions](https://gitlab.dune-project.org/core/dune-localfunctions) | releases/2.6
| [dune-functions](https://gitlab.dune-project.org/staging/dune-functions) | releases/2.6
| [dune-typetree](https://gitlab.dune-project.org/staging/dune-typetree) | releases/2.6
| [dune-pdelab](https://gitlab.dune-project.org/pdelab/dune-pdelab) | releases/2.6
| [dune-randomfield](https://gitlab.dune-project.org/oklein/dune-randomfield) | releases/2.6
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | releases/2.6 | *Optional:* For system tests
#### DUNE Requirements
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| CMake | 3.10.2 |
| GCC | 7.3 | Alternatively: LLVM Clang >=6, or Apple Clang 10
| git |
| pkg-config |
| FFTW3 | 3.3.7 | MPI support required
| Python | 3.6 |
| pip | 3.6 |
| MPI | | Tested with OpenMPI 2.1.1
| SuperLU | 5.2 |
#### DORiE Requirements
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| [HDF5](https://www.hdfgroup.org/solutions/hdf5/) | 1.10 | MPI support required
| [yaml-cpp](https://github.com/jbeder/yaml-cpp) | >= 5.2.0 |
| [muparser](http://beltoforion.de/article.php?a=muparser) | master |
| [VTK](https://vtk.org/) | >= 7.1.1 | For the Python module only
| [spdlog](https://github.com/gabime/spdlog) | 1.5.0 | Included as Git Submodule
| [Google Test](https://github.com/google/googletest) | `HEAD` | Included as Git Submodule
#### Optional Packages
| Software | Version/Branch | Comments |
| -------- | -------------- | -------- |
| [doxygen](http://www.stack.nl/~dimitri/doxygen/) | 1.8.13 | Builds documentation
| [METIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 5 | For parallel runs
| [ParMETIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 4 | For parallel runs
### Manual Installation
Installing all packages manually can be quite an effort, but useful for
......@@ -119,7 +176,7 @@ notice the warnings when compiling DORiE below!
executing
xcode-select --install
Make sure you have no pending software updates for your respective version
of macOS!
......@@ -177,41 +234,56 @@ notice the warnings when compiling DORiE below!
**Parallel runs without these two packages are possible but not supported!**
4. Clone the [DUNE modules](#dune-Packages) into a suitable folder on your
machine. Use `git checkout` to switch to the correct branches.
4. Create a directory for all your DUNE modules, including DORiE. If you already
cloned DORiE somewhere else, move the cloned folder into the DUNE module
directory.
5. Clone the [DUNE modules](#dune-Packages) into the DUNE module directory. Use
`git checkout` to switch to the correct branches. We provide a bash script
which clones all required repositories and checks out the correct branches
into the directory it is executed from. Move into the DUNE module folder and
execute it:
5. Clone DORiE into the same folder.
bash dorie/clone_dune
DORiE includes
[Git Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules),
which requires you to add the `--recurse-submodules` option to the
`git clone` command. Switch to the desired branch or tag.
6. Make sure the DORiE repository is correctly set up. DORiE includes
[Git Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules),
which are only downloaded if you add the `--recurse-submodules` option to the
`git clone` command. To make sure the submodules are cloned and checked out,
enter the DORiE repository and execute
6. Enter the parent folder, and call
git submodule init && git submodule update
CMAKE_FLAGS="-DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" ./dune-common/bin/dunecontrol all
6. Enter the DUNE module directory, and call
./dune-common/bin/dunecontrol --opts=dorie/build.opts all
to build all DUNE modules. Additionally, you can add `MAKE_FLAGS="-j X"`
to the command in order to compile on `X` processes in parallel.
If you installed software into paths not appended to your `PATH` variable,
you will have to add `CMAKE_FLAGS` to the call to make sure that CMake
finds all packages. Alternatively, you can add a custom options file. See
the [DUNE Installation Instructions](https://dune-project.org/doc/installation/)
for details. CMake will throw an error if required packages are not found.
The `build.opts` file in this repository contains required and useful CMake
variable settings for a build of DORiE. If you installed software into paths
not appended to your `PATH` variable, you will have to add more
`CMAKE_FLAGS` in the options file to make sure that CMake finds all
packages. If `<Package>_ROOT` variables suffice, you can simply prepend them
before the `dunecontrol` command. See the
[Dune Installation Docs](https://www.dune-project.org/doc/installation/) for
further information.
If you installed HDF5 from source (all **macOS** users) or use Anaconda,
specify the path to your HDF5 installation by using the `HDF5_ROOT`
variable. On Ubuntu, add the path to the APT package,
environment variable. On Ubuntu, prepend the path to the APT package,
-DHDF5_ROOT=/usr/
HDF5_ROOT=/usr/
and on macOS, add
and on macOS, prepend
-DHDF5_ROOT=<hdf5-path>
HDF5_ROOT=<hdf5-path>
to the `CMAKE_FLAGS` in the above command, replacing `<hdf5-path>` with the
path chosen as installation prefix when configuring HDF5.
in the `dunecontrol` command above, replacing `<hdf5-path>` with the
path chosen as installation prefix when configuring HDF5. Alternatively,
`export` these paths in your shell before calling `dunecontrol`, or add
them as CMake variables (with prefix `-D`) to the repository options file.
### Recommended Third-Party Software
......@@ -223,62 +295,6 @@ find a release that fits your operating system:
* [Gmsh](http://gmsh.info/): An open-source CAD that can be used to create the
`.msh` files used by DORiE to define unstructured meshes.
### Dependencies
Depending on your system configuration, there will be more packages necessary to
install DORiE on your machine. See the step-by-step manual for further details.
The specified versions are the _supported_ ones, where compatibility is ensured
by CI tests.
#### DUNE Packages
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| [dune-common](https://gitlab.dune-project.org/core/dune-common) | releases/2.6
| [dune-geometry](https://gitlab.dune-project.org/core/dune-geometry) | releases/2.6
| [dune-grid](https://gitlab.dune-project.org/core/dune-grid) | releases/2.6
| [dune-uggrid](https://gitlab.dune-project.org/staging/dune-uggrid) | releases/2.6
| [dune-istl](https://gitlab.dune-project.org/core/dune-istl) | releases/2.6
| [dune-localfunctions](https://gitlab.dune-project.org/core/dune-localfunctions) | releases/2.6
| [dune-functions](https://gitlab.dune-project.org/staging/dune-functions) | releases/2.6
| [dune-typetree](https://gitlab.dune-project.org/staging/dune-typetree) | releases/2.6
| [dune-pdelab](https://gitlab.dune-project.org/pdelab/dune-pdelab) | releases/2.6
| [dune-randomfield](https://gitlab.dune-project.org/oklein/dune-randomfield) | releases/2.6
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | releases/2.6 | *Optional:* For system tests
#### DUNE Requirements
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| CMake | 3.10.2 |
| GCC | 7.3 | Alternatively: LLVM Clang >=6, or Apple Clang 10
| git |
| pkg-config |
| FFTW3 | 3.3.7 | MPI support required
| Python | 3.6 |
| pip | 3.6 |
| MPI | | Tested with OpenMPI 2.1.1
| SuperLU | 5.2 |
#### DORiE Requirements
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| [HDF5](https://www.hdfgroup.org/solutions/hdf5/) | 1.10 | MPI support required
| [yaml-cpp](https://github.com/jbeder/yaml-cpp) | >= 5.2.0 |
| [muparser](http://beltoforion.de/article.php?a=muparser) | master |
| [VTK](https://vtk.org/) | >= 7.1.1 | For the Python module only
| [spdlog](https://github.com/gabime/spdlog) | 1.5.0 | Included as Git Submodule
| [Google Test](https://github.com/google/googletest) | `HEAD` | Included as Git Submodule
#### Optional Packages
| Software | Version/Branch | Comments |
| -------- | -------------- | -------- |
| [doxygen](http://www.stack.nl/~dimitri/doxygen/) | 1.8.13 | Builds documentation
| [METIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 5 | For parallel runs
| [ParMETIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 4 | For parallel runs
## Documentation
The documentation of DORiE is twofold. The Sphinx documentation contains a
......@@ -407,9 +423,11 @@ If the problem persists, take a look at the
and feel free to create an Issue yourself if the problem is not yet reported.
### Debugging
DORiE can be built with debugging flags via CMake. To do so, run
DORiE can be built with debugging flags via CMake. To do so, enter the
`build-cmake` directory and execute
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Debug" dunecontrol --only=dorie all
cmake -DCMAKE_BUILD_TYPE=Debug ..
make all
After building, a debugger can hook into the executables.
......@@ -421,7 +439,11 @@ CMake.
To re-create a release build, configure DORiE with the release build type by
executing
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release" dunecontrol --only=dorie all
cmake -DCMAKE_BUILD_TYPE=Release ..
make all
or by calling `dunecontrol` with the supplied options file as indicated in the
installation instructions above.
### Running System Tests
DORiE includes a testing system for comparing its results the ones of ODE
......
# NOTE: If you want to update this file with options for your own setup, create
# a copy of it. Make sure you *do not* commit any changes specific to your
# setup to the original file!
# CMake configuration options
# - Default build type: Release
# - Create virtual environment in dune-common
# - Fetch pip and install it into virtual environment
# - Prefer parallel over sequential HDF5 (required for Ubuntu/Debian)
CMAKE_FLAGS="
-DCMAKE_BUILD_TYPE=Release
-DDUNE_PYTHON_VIRTUALENV_SETUP=True
-DDUNE_PYTHON_ALLOW_GET_PIP=True
-DHDF5_PREFER_PARALLEL=True
"
#!/usr/bin/env bash
# Abort script on command failure
set -e
echo "=== Cloning DUNE modules into $(pwd) ==="
DEFAULT_BRANCH="releases/2.6"
git clone https://gitlab.dune-project.org/staging/dune-uggrid.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/oklein/dune-randomfield.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/core/dune-common.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/core/dune-geometry.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/core/dune-grid.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/core/dune-istl.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/core/dune-localfunctions.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/staging/dune-functions.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/pdelab/dune-pdelab.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/staging/dune-typetree.git -b $DEFAULT_BRANCH
git clone https://gitlab.dune-project.org/quality/dune-testtools.git -b $DEFAULT_BRANCH
......@@ -9,9 +9,6 @@ LABEL maintainer="lriedel@iup.uni-heidelberg.de"
# number of cores for parallel builds
ARG PROCNUM=1
# Compilers to be used
ARG CC=gcc
ARG CXX=g++
# copy the build context to this image
WORKDIR /opt/dune/dorie
......@@ -20,8 +17,7 @@ COPY ./ ./
# build the executable
WORKDIR /opt/dune/
RUN MAKE_FLAGS="-j${PROCNUM}" \
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol --only=dorie all
./dune-common/bin/dunecontrol --opts=dorie/build.opts --only=dorie all
# Start a fresh image as production environment
FROM $DUNE_ENV_IMAGE as prod-env
......
......@@ -6,13 +6,13 @@ LABEL maintainer="lriedel@iup.uni-heidelberg.de"
# number of cores for parallel builds
ARG PROCNUM=1
# Compilers to be used
ARG CC=gcc
ARG CXX=g++
# Upgrade Ubuntu packages
RUN apt-get clean && apt-get update && apt-get upgrade -y && apt-get clean
# Update and build DUNE modules
WORKDIR /opt/dune
COPY build.opts ./
RUN ./dune-common/bin/dunecontrol update
RUN MAKE_FLAGS="-j ${PROCNUM}" \
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol all
./dune-common/bin/dunecontrol --opts=build.opts all
......@@ -6,6 +6,9 @@ ARG PROCNUM=1
ARG CC=gcc
ARG CXX=g++
# Pass compilers as environment variables (will persist in other images)
ENV CC=$CC CXX=$CXX
# disable any prompts while installing packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean \
......@@ -44,19 +47,12 @@ RUN rm -rf /var/lib/apt/lists/* \
ENV LANG en_US.utf8
WORKDIR /opt/dune
RUN git clone https://gitlab.dune-project.org/staging/dune-uggrid.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/oklein/dune-randomfield.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/core/dune-common.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/core/dune-geometry.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/core/dune-grid.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/core/dune-istl.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/core/dune-localfunctions.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/staging/dune-functions.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/pdelab/dune-pdelab.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/staging/dune-typetree.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/quality/dune-testtools.git -b releases/2.6
WORKDIR /opt/dune
# Clone DUNE modules
COPY clone_dune ./
RUN bash clone_dune
# Configure and build DUNE modules
COPY build.opts ./
RUN MAKE_FLAGS="-j ${PROCNUM}" \
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol all
./dune-common/bin/dunecontrol --opts=build.opts all
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment