Commit b6b54278 authored by Lukas Riedel's avatar Lukas Riedel

Readme: simple Docker installation #2, manual installation on Mac #26, debugging in Docker #22.

Small tweaks to Dockerfile
parent f147acad
......@@ -3,6 +3,6 @@ MAINTAINER Dion Häfner
WORKDIR /opt/dune
ADD . /opt/dune/dorie/
RUN ./dune-common/bin/dunecontrol --only=dorie all -DCMAKE_CXX_FLAGS="-O3"
RUN ./dune-common/bin/dunecontrol --only=dorie all
RUN ./dune-common/bin/dunecontrol --only=dorie make install
#RUN ./dune-common/bin/dunecontrol --only=dorie make test
WORKDIR /sim
......@@ -16,8 +16,25 @@ DORiE is a [DUNE](https://dune-project.org/) module and requires several other D
In any case, DORiE is configured, built, and installed via the [DUNE Buildsystem](https://dune-project.org/doc/installation/), using the `dunecontrol` script to handle DUNE-internal dependencies.
## Docker Installation
Install Docker on your machine. We have prepared a [DORiE DUNE Environment Image on Dockerhub](https://hub.docker.com/r/dorie/dune-env/), which is a modified image of the Ubuntu OS that has all dependencies readily installed. The current version is 2.4 (referencing the DUNE module version 2.4).
## Docker Installation - Simple Setup
This setup is intended for users who simply want to start computations with DORiE.
Install Docker on your machine. Then, use `git clone` to download the DORiE repository into a suitable directory on your machine. Enter the directory, and call
docker build -t dorie .
Docker will use a prepared image from Dockerhub and install DORiE into it. You can now call DORiE via the Docker deamon from any directory `dir` on your machine:
docker run -i -t -v <dir>:/sim dorie dorie <command>
The `-v` option tells docker to mount the directory into the container work directory (`sim`).
In the section 'Usage' you will find a list of possible commands. Notice that input and output files can only be placed in the `<dir>` directory or subdirectories thereof. You must use relative paths in the DORiE configuration files.
## Docker Installation - Interactive Setup
This setup is intended for advanced users. You will gain access to the DORiE module outside the container.
We have prepared a [DORiE DUNE Environment Image on Dockerhub](https://hub.docker.com/r/dorie/dune-env/), which is a modified image of the Ubuntu OS that has all dependencies readily installed. The current version is 2.4 (referencing the DUNE module version 2.4).
Run a new container from this image by calling
docker run -i -t dorie/dune-env:2.4 /bin/bash
......@@ -78,10 +95,11 @@ Depending on your system configuration, there will be more packages necessary to
If you also want to build the documentation, you will additionally need to install Doxygen, Sphinx and Breathe.
### Manual Installation on Ubuntu
The following instructions follow the basic installation on a fresh Ubuntu system and are similarly executed to create the DORiE Docker image.
### Step-by-step Instructions
These instructions are suitable for a clean **Ubuntu** or **Mac OS X** setup. The main difference between the two systems is the package manager. Ubuntu has the APT manager already built in. On Mac, we recommend installing [Homebrew](http://brew.sh/). If you must use [MacPorts](https://www.macports.org/), you need to check if some of the packages require different installation options than displayed here.
1. Install third party packages:
**Ubuntu:**
apt update
apt install autoconf bison cmake flex gcc-5 g++-5 gfortran-5 \
......@@ -90,10 +108,30 @@ The following instructions follow the basic installation on a fresh Ubuntu syste
libsuperlu-dev libxft-dev python-dev python-pip python-sphinx \
python-breathe doxygen
**Mac OS X:**
brew update
brew install automake cmake doxygen gcc libtool libpng open-mpi \
pkg-config python3 superlu
brew install hdf5 --with-mpi
brew install fftw --with-mpi
2. Install the necessary Python packages using `pip`:
python -m pip install virtualenv
3. **Mac OS X** only:
1. The Apple Clang compiler shipped with CMake is not suitable for compiling DUNE and UG. Before proceeding, call
export CC=gcc-6
export CXX=g++-6
to enfore the Homebrew'd GCC compiler. Notice that this variable export only lasts for your current terminal session. Always make sure that the configuration tool actually finds GCC instead of the Apple Clang.
2. Avoid the Apple Python 2 interpreter, located in `/usr/bin`. dune-python searches for and binds to the symlink `python` first. If you did **not** install a custom Python 2 interpreter, create a dummy symlink in the `/usr/local/bin` directory:
ln -svf /usr/local/bin/python3 /usr/local/bin/python
3. Clone the specified version of UG into a suitable folder on your machine. Install it by calling
autoreconf -is
......@@ -112,6 +150,7 @@ The following instructions follow the basic installation on a fresh Ubuntu syste
This may require `sudo` rights on your machine. If you choose not to do this, make sure to append the location of `dunecontrol` (`dune-common/bin`) and `dorie` (`dorie/build-cmake/bin`) to your search path.
## Recommended Third-Party Software
The following software packages are cross-platform, so you should be able to find a release that fits your operating system:
......@@ -131,27 +170,37 @@ The documentation can be built after DORiE has been properly configured (i.e., b
The documentation files can now be found in the subfolder `dorie/build-cmake/doc`.
## Usage
## Run, DORiE, Run!
During `make install`, DORiE installs a wrapper to access the functions and executables of DORiE from any location on your device. After a successful installation, you can call the wrapper by simply executing
dorie <command>
If you did not run `dunecontrol make install`, you can find the wrapper in the `dorie/build-cmake/bin` folder of your installation.
To start your first simulation run, create a new directory and enter it. Place some exemplary configuration files in there by calling
To start your first simulation run, create a new directory and enter it. Place some exemplary configuration and boundary condition data files in there by calling
dorie create
DORiE encapsulates two routines, the Parameter Field Generator (PFG) and the main program routine. Each takes a single `.ini` configuration file as arguments.
Tweak the paramters to your liking and then call
dorie pfg <inifile>
to create a parameter field file. Make sure that you instruct the main routine to call the file you just created. Then call
dorie run <inifile>
to execute the program.
to execute the main program.
List all available commands and find further help by executing
dorie help
or
dorie <command> -h
## Troubleshooting
CMake heavily caches the results of its configuration process. In case you encounter errors or strange behavior, especially after an update, you should delete the DORiE build folder (called `build-cmake` by default) and re-install DORiE using `dunecontrol`.
......@@ -170,6 +219,17 @@ To re-create a release build, configure DORiE with the release build type by exe
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release" dunecontrol --only=dorie all
#### Debugging inside Docker
A debugger needs special security privileges usually not provided by the Docker engine. To enable debugging inside Docker, these privileges have to be granted when calling `docker run` by adding the options
--security-opt seccomp=unconfined
The prepared Docker image does not contain a debugger. You can install GDB by calling
apt install gdb
inside the running container.
### DORiE is running, but I suspect that something is wrong
You can execute system tests in order to ensure that DORiE is running correctly and producing the expected results:
......
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