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.
wget http://ftp.us.debian.org/debian/pool/main/s/singularity-container/singularity-container_3.5.2+ds1-1_amd64.deb sudo apt install containernetworking-plugins squashfs-tools sudo dpkg -i singularity-container_3.5.2+ds1-1_amd64.deb
[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.