HUB
Sign inSign up

tck199732/spiritroot

By tck199732

•Updated almost 2 years ago

for compiling `SpiRITROOT` ( `2024Spring` branch), used in the SpiRIT TPC experiment at RIKEN.

Image
Data science
0

1.0K

tck199732/spiritroot repository overview

⁠docker-spiritroot

This repository provides a Docker image for compiling a specific branch of SpiRITROOT--2024Spring⁠, used in the SpiRIT TPC experiment at RIKEN.

Due to the incompatibility of several outdated dependencies, installing these on modern Linux distributions such as Ubuntu 22.04 or 24.04 is challenging. This Docker image replicates the working setup from Hokusai HPC at RIKEN, starting with a base image of RockyLinux 8.8⁠.

⁠Content

⁠Prerequiste

Before using this repository, ensure you have the following:

  • Docker⁠, if you have root privileges.

  • [Optional] Singularity, typically pre-installed on HPC systems as an alternative to Docker

  • Clone the SpiRITROOT repository:

git clone -b 2024Spring https://github.com/SpiRIT-Collaboration/SpiRITROOT

⁠Usage (Docker)

⁠1. pull the docker image, see here⁠
docker pull tck199732/spiritroot:latest
⁠2. run the container
docker run -it -v ${host_dir}:${container_dir} tck199732/spiritroot
  • Replace ${host_dir} with the path to the SpiRITROOT directory on your machine.
  • Replace ${container_dir} with the desired mount point inside the container (e.g., /root/SpiRITROOT).
⁠3. Compile SpiRITROOT
  • Optional] Compilating SpiRITROOT generates a file VERSION.compiled which indicates the compiled version of SpiRITROOT formatted according to git commits and branch being used. To access these information, one must navigate to the ${container_dir} and run
git config --global --add safe.directory $(pwd)
  • Navigate to the mounted directory in the container:
# in the SpiRITROOT directory 
mkdir -p build
cd build
cmake .. -DCMAKE_CXX_COMPILER=g++ \
 -DROOT_CONFIG_EXECUTABLE=${SIMPATH}/bin/root-config \
 -DROOT_CINT_EXECUTABLE=${SIMPATH}/bin/rootcint \
 -DEigen3_DIR=$Eigen3_DIR
make -j4
⁠4. Verify Compilation
  • Source the config.sh file
source config.sh

Expected output:

[root@e79fa05ae8ee build]# . config.sh 
System during compilation: Rocky Linux release 8.10 (Green Obsidian)
                           x86_64
System now               : Rocky Linux release 8.10 (Green Obsidian)
                           x86_64
[root@e79fa05ae8ee build]# 
⁠5. Post-Execution
  • Exit the container and restore file ownership:
chown -R ${USER}:${USER} SpiRITROOT

⁠Singularity - for users without sudo privilege

It is hard to use Docker without root privileges, especially on HPC. Instead, (Singularity)[https://sylabs.io/singularity/⁠] users an alternative way to use Docker images⁠. To check if singularity command is available, do the following:

user@server $ singularity --version
singularity-ce version 3.11.4-1.el8
  1. build the singularity image file
user@server $ singularity build image.sif docker://tck199732/spiritroot
INFO:    Starting build...
Getting image source signatures
...
INFO:    Creating SIF file...
INFO:    Build complete: image.sif

This process usually takes a few minutes. You will probably see a lot of warning message warn rootless{opt/root/lib/libASImage.so} ignoring (usually) harmless EPERM on setxattr "user.rootlesscontainers but it probably does not affect its functionality. An file named image.sif is now generated.

  1. Compile SpiRIROOT with singularity image Unlike Docker images, singularity mounts the host system to the container and retains the user privileges. To compile SpiRIROOT, prepare a script for the procedures, i.e.
#!/bin/bash
# compile.sh
mkdir -p build
cd build
cmake .. -DCMAKE_CXX_COMPILER=g++ \
 -DROOT_CONFIG_EXECUTABLE=${SIMPATH}/bin/root-config \
 -DROOT_CINT_EXECUTABLE=${SIMPATH}/bin/rootcint \
 -DEigen3_DIR=$Eigen3_DIR
make -j4
cd ..

and make it an executable and finally run it with singularity

chmod +x ./compile.sh
singularity exec image.sif ./compile.sh
  1. Mounting data to singularity container Singularity automatically mounts your user directory but not the shared location of data. To mount it to the container,
user@server $ singularity exec --bind ${host_dir}:${container_dir} ./ana.sh

Tag summary

Content type

Image

Digest

sha256:db63a62fe…

Size

4.5 GB

Last updated

almost 2 years ago

docker pull tck199732/spiritroot