This page describes how to build OGS with the help of a Linux container (for developers). To run OGS with the help of a container go to the user guide (for developers).
Singularity is a Linux container runtime similar to Docker. Key advantages over Docker are
Singularity per default mounts your home directory and also passes your current working directory when starting a container. Therefore it is easy to use it for development.
CentOS 6/7 / RedHat: Install via EPEL.
Ubuntu 20.04 / Debian Sid:
wget http://ftp.us.debian.org/debian/pool/main/s/singularity-container/singularity-container_3.9.6+ds1-1_amd64.deb
sudo apt install containernetworking-plugins squashfs-tools
sudo dpkg -i singularity-container_3.9.6+ds1-1_amd64.deb
singularity
.If you do not have one of the above OS versions install Singularity from source.
[git clone ogs]
singularity pull docker://registry.opengeosys.org/ogs/ogs/gcc # Downloads the image to gcc_latest.sif
# OR: Pull the image docker://registry.opengeosys.org/ogs/ogs/gcc-gui image for compiling the Data Explorer
singularity shell gcc_latest.sif
[Now inside the container]
mkdir build; cd build
cmake ../ogs -DCMAKE_BUILD_TYPE=Release -DOGS_DISABLE_COMPILER_CACHE=ON # OR set env var CCACHE_DIR
ninja
./bin/ogs
Once OGS executable is built it can be called from outside the container:
singularity exec gcc_latest.sif build/bin/ogs some/path/project.prj
This starts the container, mounts your home directory inside the container, passes the current working directory and runs the OGS executable (which is in your home directory which is mounted inside the container) with the passed project file. Everything works as expected and is transparent to the user. When OGS finishes the container stops and you returns to the host system.
You can download a prebuilt container from Docker Hub as shown above (e.g. singularity pull docker://ogs6/gcc
). But we also provide a container generator to create a specific container for your needs.
This article was written by Lars Bilke. If you are missing something or you find an error please let us know.
Generated with Hugo 0.122.0
in CI job 504124
|
Last revision: November 12, 2024
Commit: [BL/MPI] Use MPI_COMM_WORLD in reduceMin 4aae83e
| Edit this page on