Skip to content

Using Docker container

Kevin" Seung Whan Chung edited this page Jun 15, 2023 · 18 revisions

Quick Start

Docker container librom_env provides a containerized environment with all the prerequisites for libROM. In order to compile and use libROM in the Docker container, follow these steps:

docker pull ghcr.io/llnl/librom/librom_env:latest
  • Clone libROM repository
git clone https://github.com/LLNL/libROM.git
  • Launch the Docker container with the cloned repository
docker run -it --volume ./libROM:/home/test/libROM ghcr.io/llnl/librom/librom_env:latest
  • This will lead to a terminal with the cloned repository mounted at ~/libROM. Compile libROM with the pre-set environment variables
mkdir build
cd build
cmake ~/libROM -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUSE_MFEM=${USE_MFEM} -DMFEM_USE_GSLIB=${MFEM_USE_GSLIB}
make -j 4

Some notes about using the Docker container:

  • Any change within the container will not be saved, except those happening in the mounted directory ./libROM.
  • Any change in /home/test/libROM in the container is instantaneously reflected into the actual directory ./libROM, and vice versa.

Quartz/Singularity

Quartz has singularity available in the default path (no module required). If you want to run a Docker container built elsewhere, you will need to convert it to a Singularity format first. Here is an example pulling from GitHub Container Registry:

singularity pull librom_env docker://ghcr.io/llnl/librom/librom_env:latest

Login with your github username/personal access token for SingularityCE.

singularity remote login --username your-github-username docker://ghcr.io

Run container shell

singularity shell --cleanenv --contain -B ~/libROM:/g/g92/chung28/libROM docker://ghcr.io/llnl/librom/librom_env:latest 

Some details

  • Machine architecture: Linux-x86_64
  • From: ubuntu:22.04
  • Dependencies:
    • cmake-3.22.1
    • hypre-2.20.0
    • parmetis-4.0.3
    • gslib-1.0.7
    • mfem: latest verified commit on May 02, 2023
    • googletest-v1.12.1: the last release that supports c++11
  • Environmental variables preset for libROM cmake:
    • TOOLCHAIN_FILE=/env/dependencies/librom_env.cmake
    • BUILD_TYPE=Optimized
    • USE_MFEM=On
    • MFEM_USE_GSLIB=On
  • Miscellaneous packages
    • Debugging tools: valgrind, lldb, gdb
    • Python packages: numpy, scipy, argparse, tables, PyYAML, h5py, pybind11, pytest, mpi4py
Clone this wiki locally