Commit decadc94 authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos Committed by Lukas Riedel

Update Docker base image to Ubuntu 20.04 LTS

This updates the Docker base image and testing system to the most
recent Ubuntu with LTS. Accordingly, the software requirements have
been updated.

* Update Docker base image to Ubuntu `focal`.
* Switch to Ubuntu version based tagging scheme of base image.
* Update CMake configuration to CMake v3.16.
* Use spdlog as external dependency and remove Git Submodule.
* Update installation instructions in README.md
* Make code compliant to recent Python and compiler versions.
parent 4b15890e
......@@ -6,14 +6,13 @@ variables:
CPUS_DIND: 2
DOCKER_LOGIN:
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PW
# DUNE environment image
BASE_IMAGE: dorie/dune-env
# Use semantic versioning (not the version of DUNE) and bump according to
# to whether changes are backwards-compatible or not.
# NOTE: Update the default value in the Dockerfiles accordingly!
IMAGE_VERSION: "1.3"
DUNE_ENV_IMAGE: ${BASE_IMAGE}:img-v${IMAGE_VERSION}
BASE_IMAGE_NAME: dorie/dune-env
# NOTE: Bump versions if Dockerfiles are updated
BASE_IMAGE_UBUNTU_VERSION: focal
BASE_IMAGE_VERSION: "1"
DUNE_ENV_IMAGE: ${BASE_IMAGE_NAME}:${BASE_IMAGE_UBUNTU_VERSION}-v${BASE_IMAGE_VERSION}
CMAKE_FLAGS:
-DDUNE_PYTHON_VIRTUALENV_SETUP=True
......
[submodule "plugins/vendor/spdlog"]
path = plugins/vendor/spdlog
url = https://github.com/gabime/spdlog.git
[submodule "plugins/vendor/googletest"]
path = plugins/vendor/googletest
url = https://github.com/google/googletest.git
......
......@@ -15,6 +15,7 @@
* Linerar solver for finite volumes changed from `AMG_4_DG` to
`BCGS_AMG_SSOR` !204
* Simplify installation instructions !205
* Update Docker base image to Ubuntu Focal Fossa 20.04 LTS !189
### Fixed
......
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16)
project(dorie C CXX)
# Configuration options
......
......@@ -129,15 +129,16 @@ by CI tests.
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| CMake | 3.10.2 |
| GCC | 7.3 | Alternatively: LLVM Clang >=6, or Apple Clang 10
| CMake | 3.16 |
| GCC | 9.3 | Alternatively: LLVM Clang 10, or Apple Clang 11
| git |
| pkg-config |
| FFTW3 | 3.3.7 | MPI support required
| Python | 3.6 |
| pip | 3.6 |
| MPI | | Tested with OpenMPI 2.1.1
| FFTW3 | 3.3.8 | MPI support required
| Python | 3.8 |
| pip | 20 |
| MPI | | Tested with OpenMPI 4.0.3
| SuperLU | 5.2 |
| OpenGL | 1.3 | Or another GL implementation compatible with VTK 9
#### DORiE Requirements
......@@ -146,15 +147,14 @@ by CI tests.
| [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
| [spdlog](https://github.com/gabime/spdlog) | >= 1.0 |
| [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
| [doxygen](http://www.stack.nl/~dimitri/doxygen/) | 1.8.17 | 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
......@@ -204,28 +204,28 @@ notice the warnings when compiling DORiE below!
apt update
apt install cmake doxygen gcc g++ gfortran \
git libatlas-base-dev libfftw3-dev libfftw3-mpi-dev \
libfreetype6-dev libhdf5-mpi-dev libmuparser-dev \
libopenmpi-dev libpng-dev libsuperlu-dev libyaml-cpp-dev \
libxft-dev python3-dev python3-pip python3-vtk7
libfreetype6-dev libgl-dev libhdf5-mpi-dev libmuparser-dev \
libopenmpi-dev libpng-dev libspdlog-dev libsuperlu-dev \
libyaml-cpp-dev libxft-dev python3-dev python3-pip
**macOS:**
brew update
brew install cmake doxygen fftw gcc libpng open-mpi muparser \
pkg-config python3 superlu yaml-cpp
pkg-config python3 spdlog superlu yaml-cpp
2. **macOS only:** Install HDF5 with MPI support from source.
3. **macOS only:** Install HDF5 with MPI support from source.
1. Download an archive of the
[HDF5 source code](https://www.hdfgroup.org/downloads/hdf5/source-code/),
and extract it.
2. Enter the extracted folder. In there, create a `build` directory, and
1. Enter the extracted folder. In there, create a `build` directory, and
enter it:
mkdir build && cd build
3. Configure your build. If you followed the instructions above, the
1. Configure your build. If you followed the instructions above, the
OpenMPI C compiler is reachable via the command `mpicc`. If not, you have
to specify a full path to it. Use the option `prefix` to specify where
you want the package to be installed. This should *not* be a
......@@ -234,11 +234,11 @@ notice the warnings when compiling DORiE below!
./../configure CC=mpicc --prefix=<hdf5-path> --enable-parallel
4. Build and install the library:
1. Build and install the library:
make && make install
3. The parallel linear solver of DORiE can make use of the ParMETIS package.
4. The parallel linear solver of DORiE can make use of the ParMETIS package.
If you want to run DORiE in parallel on multiple processes, additionally
install METIS and ParMETIS:
......@@ -251,11 +251,11 @@ notice the warnings when compiling DORiE below!
**Parallel runs without these two packages are possible but not supported!**
4. Create a directory for all your DUNE modules, including DORiE. If you already
5. 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
6. 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
......@@ -263,7 +263,7 @@ notice the warnings when compiling DORiE below!
bash dorie/clone_dune
6. Make sure the DORiE repository is correctly set up. DORiE includes
7. 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,
......@@ -271,7 +271,7 @@ notice the warnings when compiling DORiE below!
git submodule init && git submodule update
6. Enter the DUNE module directory, and call
8. Enter the DUNE module directory, and call
./dune-common/bin/dunecontrol --opts=dorie/build.opts all
......
......@@ -87,7 +87,7 @@ function(dorie_compile_instance)
# link to dependencies
target_link_libraries(${lib_name}
PUBLIC
spdlog
spdlog::spdlog
muparser::muparser
hdf5
yaml-cpp
......
......@@ -42,6 +42,9 @@ find_package (yaml-cpp 0.5.2 REQUIRED)
# muparser
find_package (muparser REQUIRED)
# spdlog
find_package(spdlog 1.0 REQUIRED)
# Report the DUNE libs
message (STATUS "DUNE Libraries: ${DUNE_LIBS}")
......
......@@ -99,7 +99,7 @@ function(dorie_add_unit_test)
# add to build target and employ compile options
target_link_libraries(${UNIT_TEST_TARGET}
muparser::muparser hdf5 yaml-cpp spdlog)
muparser::muparser hdf5 yaml-cpp spdlog::spdlog)
# add_coverage_links(${UNIT_TEST_TARGET})
target_compile_definitions(${UNIT_TEST_TARGET}
......@@ -241,7 +241,7 @@ function(dorie_add_metaini_test)
if(NOT SYSTEM_TEST_TARGET)
# Link to dependencies
target_link_libraries(${created_targets}
muparser::muparser hdf5 yaml-cpp spdlog)
muparser::muparser hdf5 yaml-cpp spdlog::spdlog)
# Add coverage flags if enabled
if(COVERAGE_REPORT)
......
......@@ -21,13 +21,14 @@ required software packages. If you followed the installation instructions in
the :doc:`ReadMe </markdown/README>`, you are already set and can start
using them inside the :ref:`virtual environment <cli-venv>`.
If you install the DORiE Python package separately, you may need to install the
required VTK library, depending on your operating system. **Ubuntu** users need
to install ``python-vtk`` via
If you install the DORiE Python package separately, you may need to install
additional prerequisites for the VTK library, depending on your operating
system. **Linux** users need to install the OpenGL library. On Ubuntu and
similar systems, call
.. code-block:: console
apt-get install python-vtk
apt install libgl-dev
Example Code
......
......@@ -15,9 +15,9 @@ DUNE image with DORiE installed.
We differentiate between two base images, one where DUNE is compiled with GCC,
and one where it is compiled with Clang.
The tags of `dune-env` comply to [semantic versioning](https://semver.org/) and
take the form `X.Y`. Backwards compatible changes increment `Y`, other changes
`X`. This happens independently from DUNE versions used in the image.
The tags of `dune-env` indicate the version of the base Ubuntu image followed
by the version number of the image configuration. This number is increased
whenever the image changes.
## GitLab CI configuration
......
ARG BASE_IMG_VERSION=1.3
ARG DUNE_ENV_IMAGE=dorie/dune-env:img-v${BASE_IMG_VERSION}
ARG BASE_IMG_UBUNTU_VERSION=focal
ARG BASE_IMG_VERSION=1
ARG DUNE_ENV_IMAGE=dorie/dune-env:${BASE_IMG_UBUNTU_VERSION}-v${BASE_IMG_VERSION}
FROM $DUNE_ENV_IMAGE
# start build image
FROM ${DUNE_ENV_IMAGE} as build-env
......
ARG BASE_IMG_VERSION=1.3
ARG DUNE_ENV_IMAGE=dorie/dune-env:img-v${BASE_IMG_VERSION}
ARG BASE_IMG_UBUNTU_VERSION=focal
ARG BASE_IMG_VERSION=1
ARG DUNE_ENV_IMAGE=dorie/dune-env:${BASE_IMG_UBUNTU_VERSION}-v${BASE_IMG_VERSION}
FROM $DUNE_ENV_IMAGE
LABEL maintainer="lriedel@iup.uni-heidelberg.de"
......
FROM ubuntu:bionic
FROM ubuntu:focal
LABEL maintainer="lriedel@iup.uni-heidelberg.de"
# number of cores for parallel builds
ARG PROCNUM=1
......@@ -26,6 +26,7 @@ RUN apt-get clean \
libfftw3-dev \
libfftw3-mpi-dev \
libfreetype6-dev \
libgl-dev \
libgraphviz-dev \
libhdf5-mpi-dev \
libmetis-dev \
......@@ -33,13 +34,13 @@ RUN apt-get clean \
libopenmpi-dev \
libpng-dev \
libparmetis-dev \
libspdlog-dev \
libsuperlu-dev \
libxft-dev \
libyaml-cpp-dev \
locales \
python3-dev \
python3-pip \
python3-vtk7 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
......
......@@ -68,7 +68,6 @@ dorie_add_metaini_test(
METAINI test-time-step-controller.mini.in
CREATED_TARGETS tsc_target
)
target_link_libraries(${tsc_target} spdlog)
# grid creator test
dorie_add_metaini_test(
......@@ -107,7 +106,6 @@ dorie_add_metaini_test(
METAINI test-param-richards.mini.in
CREATED_TARGETS param_target
)
target_link_libraries(${param_target} spdlog)
dorie_add_metaini_test(
UNIT_TEST
......
# enable usage of 'add_test' in submodules (DUNE throws error otherwise)
set(DUNE_REENABLE_ADD_TEST True)
# disable spdlog tests and examples
set(SPDLOG_BUILD_TESTING OFF)
set(SPDLOG_BUILD_EXAMPLES OFF)
set(SPDLOG_BUILD_BENCH OFF)
add_subdirectory(spdlog EXCLUDE_FROM_ALL)
# Make option() honor normal variables
cmake_policy(SET CMP0077 NEW)
# Include the Google Test lib
set(INSTALL_GTEST OFF)
......
Subproject commit ca9c83f824270a7ee1d183f29faa01262f810fd6
......@@ -32,9 +32,9 @@ def test_dorie(iniinfo,inifile,executable):
print("Calling dorie with: " + " ".join(command))
# Run DORiE and measure total execution time
start = time.clock()
start = time.perf_counter()
return_code = subprocess.call(command)
end = time.clock()
end = time.perf_counter()
runtime = end - start
if return_code == 1 or not "_evaluation" in iniinfo:
......
......@@ -6,6 +6,9 @@
#include <string>
#include <iostream>
// Filesystem access
#include <unistd.h>
#include "test-mass-conservation.hh"
#include <dune/common/exceptions.hh>
......
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