initial upload

This commit is contained in:
2025-12-17 10:53:43 +08:00
commit f3f1778f77
308 changed files with 129940 additions and 0 deletions

45
singularity/Dockerfile Normal file
View File

@@ -0,0 +1,45 @@
FROM ubuntu:latest AS spython-base
ADD ../../TomoATT /opt/TomoATT
LABEL Maintainer MasaruNagaso
LABEL Version v1.0
ENV PKG_DIR=/opt/ompi
ENV SINGULARITY_PKG_DIR=$PKG_DIR
ENV SINGULARITYENV_APPEND_PATH=$PKG_DIR/bin
ENV SINGULAIRTYENV_APPEND_LD_LIBRARY_PATH=$PKG_DIR/lib
ENV PATH=$PKG_DIR/bin:$PATH
ENV PATH=/opt/TomoATT/build/bin:$PATH
RUN echo "Installing required packages..."
RUN apt-get update && apt-get install -y wget git bash gcc gfortran g++ make file cmake
RUN export PKG_DIR=/opt/packages
RUN export NPROC=4
RUN echo "Installing Open MPI"
RUN export OMPI_VERSOIN_MAJOR=3.0
RUN export OMPI_VERSION_FULL=3.0.1
RUN export OMPI_URL="https://download.open-mpi.org/release/open-mpi/v$OMPI_VERSOIN_MAJOR/openmpi-$OMPI_VERSION_FULL.tar.gz"
RUN mkdir -p /tmp/ompi
RUN mkdir -p /opt
RUN cd /tmp/ompi && wget -O openmpi-$OMPI_VERSION_FULL.tar.gz $OMPI_URL && tar -xvf openmpi-$OMPI_VERSION_FULL.tar.gz
RUN cd /tmp/ompi/openmpi-$OMPI_VERSION_FULL && ./configure --prefix=$PKG_DIR && make -j$NPROC && make install
RUN export PATH=$PKG_DIR/bin:$PATH
RUN export LD_LIBRARY_PATH=$PKG_DIR/lib:$LD_LIBRARY_PATH
RUN export MANPATH=$PKG_DIR/share/man:$MANPATH
RUN echo "openmpi installed."
RUN echo "Compiling hdf5"
RUN export HDF5_VERSION_MAJOR=1.13
RUN export HDF5_VERSION_FULL=1.13.2
RUN export HDF5_URL="https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-$HDF5_VERSION_MAJOR/hdf5-$HDF5_VERSION_FULL/src/hdf5-$HDF5_VERSION_FULL.tar.gz"
RUN mkdir -p /tmp/hdf5
RUN cd /tmp/hdf5 && wget -O hdf5-$HDF5_VERSION_FULL.tar.gz $HDF5_URL && tar -xvf hdf5-$HDF5_VERSION_FULL.tar.gz && cd hdf5-$HDF5_VERSION_FULL
RUN tar -xvf hdf5-$HDF5_VERSION_FULL.tar.gz && cd hdf5-$HDF5_VERSION_FULL
RUN CC=mpicc CXX=mpic++ ./configure --enable-parallel --enable-unsupported --enable-shared --enable-cxx --prefix=$PKG_DIR && make -j$NPROC && make install
RUN echo "hdf5 installed."
RUN cd /opt/TomoATT
RUN mkdir -p build && cd build && rm -rf ./*
RUN cmake .. -DCMAKE_PREFIX_PATH=$PKG_DIR
RUN make -j$NPROC
RUN echo "TomoATT installed."

View File

@@ -0,0 +1,47 @@
FROM centos:6
# install wget without yum
RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && \
curl https://www.host-stage.net/hsmirrors/centos6repofix >/etc/yum.repos.d/CentOS-Base.repo && \
yum clean all
RUN yum update ca-certificates -y
# install dependencies
RUN yum update -y && \
yum groupinstall -y 'Development Tools' && \
yum install -y \
openssl-devel \
libuuid-devel \
libseccomp-devel \
wget \
squashfs-tools \
cryptsetup
# install go
ENV VERSION=1.16.2 OS=linux ARCH=amd64
RUN wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz && \
tar -C /usr/local -xzvf go$VERSION.$OS-$ARCH.tar.gz && \
rm go$VERSION.$OS-$ARCH.tar.gz
ENV PATH="${PATH}:/usr/local/go/bin"
# install singularity of 3.6.4
RUN wget https://github.com/apptainer/singularity/releases/download/v3.6.4/singularity-3.6.4.tar.gz && \
tar -xvf singularity-3.6.4.tar.gz && \
rm singularity-3.6.4.tar.gz && \
cd singularity && \
./mconfig && \
make -C builddir && \
make -C builddir install
# install singularity of 3.9
#ENV VERSION=3.9.5
#RUN wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-ce-${VERSION}.tar.gz && \
# tar -xzf singularity-ce-${VERSION}.tar.gz && \
# cd singularity-ce-${VERSION} && \
# ./mconfig && \
# make -C builddir && \
# make -C builddir install

View File

@@ -0,0 +1,47 @@
FROM nvidia/cuda:10.2-devel-centos6
# install wget without yum
RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && \
curl https://www.host-stage.net/hsmirrors/centos6repofix >/etc/yum.repos.d/CentOS-Base.repo && \
yum clean all
RUN yum update ca-certificates -y
# install dependencies
RUN yum update -y && \
yum groupinstall -y 'Development Tools' && \
yum install -y \
openssl-devel \
libuuid-devel \
libseccomp-devel \
wget \
squashfs-tools \
cryptsetup
# install go
ENV VERSION=1.16.2 OS=linux ARCH=amd64
RUN wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz && \
tar -C /usr/local -xzvf go$VERSION.$OS-$ARCH.tar.gz && \
rm go$VERSION.$OS-$ARCH.tar.gz
ENV PATH="${PATH}:/usr/local/go/bin"
# install singularity of 3.6.4
RUN wget https://github.com/apptainer/singularity/releases/download/v3.6.4/singularity-3.6.4.tar.gz && \
tar -xvf singularity-3.6.4.tar.gz && \
rm singularity-3.6.4.tar.gz && \
cd singularity && \
./mconfig && \
make -C builddir && \
make -C builddir install
# install singularity of 3.9
#ENV VERSION=3.9.5
#RUN wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-ce-${VERSION}.tar.gz && \
# tar -xzf singularity-ce-${VERSION}.tar.gz && \
# cd singularity-ce-${VERSION} && \
# ./mconfig && \
# make -C builddir && \
# make -C builddir install

51
singularity/README.md Normal file
View File

@@ -0,0 +1,51 @@
# Singularity image of TomoATT project
[Singularity](https://docs.sylabs.io/guides/3.10/user-guide/introduction.html) is a container technology that prepare a pre-compiled project's executable with an environment required dependencies (this is called a container image).
This is very useful for the users who are not familiar with the process of compiling the project's executable and installing the required dependencies, and also for the users who are not allowed to install the required dependencies on their system.
Once the container image is prepared, this image can be uploaded on singularity-hub.org, and the users can download the image and run the project's executable on their system instantly.
[Docker](https://www.docker.com/) is another container technology similar to Singularity, which is rather popular in the Information Technology (IT) community. However, Docker may not access the MPI library on the native system, which Singularity can do, and this cause degradation of the performance of the application.
Therefore, Singularity is more popular and suitable in scientific computing community and often used in the HPC environment.
This directry includes a singularity receipe file (*.def) to build a container image of TomoATT project.
To build the container image,
``` bash
sudo singularity build tomoatt.sif tomoatt.def
```
To run the TomoATT executable on the container image,
``` bash
singularity run tomoatt.sif TOMOATT
```
To run the TomoATT executable on the container image with native MPI library,
``` bash
mpirun -n 8 singularity run tomoatt.sif TOMOATT -i input_params.yml
```
For utilizing the native MPI library, the version number of OpenMPI should be the same between the native system and the container image.
The two variables in tomoatt.def file need to be modified for this purpose.
``` bash
export OMPI_VERSOIN_MAJOR=3.0
export OMPI_VERSION_FULL=3.0.1
```
# For running the container image on the HPC with old kernel environment
Some HPC systems have old kernel environment, e.g. CentOS 6, RHEL 6, and Ubuntu 16.04.
In this case, the container image cannot be run on the HPC system. (The error message is "FATAL: kernel too old")
To create a container image that can be run on the HPC system, this image needs to be built on the old kernel environment as well.
For this purpose, we use [docker](https://www.docker.com/) for virtualy creating an old kernel environment, and then build the container image on it.
To build the container image on the old kernel environment,
``` bash
docker build -t singularity_on_centos6 -f Dockerfile_singularity_on_centos6 .
```
To build the container image on the old kernel environment,
``` bash
docker run --privileged -v "(full path to)/TomoATT:/TomoATT" singularity_on_centos6 singularity build /TomoATT/singularity/tomoatt.sif /TomoATT/singularity/tomoatt.def
```

87
singularity/tomoatt.def Normal file
View File

@@ -0,0 +1,87 @@
Bootstrap: docker
From: ubuntu:16.04
%help
This is a test container.
%files
../../TomoATT /opt/TomoATT
%environment
export PKG_DIR=/opt/packages
export SINGULARITY_PKG_DIR=$PKG_DIR
export SINGULARITYENV_APPEND_PATH=$PKG_DIR/bin
export SINGULAIRTYENV_APPEND_LD_LIBRARY_PATH=$PKG_DIR/lib
export PATH=$PKG_DIR/bin:$PATH
export PATH=/opt/TomoATT/build/bin:$PATH
export LD_LIBRARY_PATH=$PKG_DIR/lib:$LD_LIBRARY_PATH
%post
echo "Installing required packages..."
apt-get update && apt-get install -y wget git bash gcc gfortran g++ make file apt-transport-https ca-certificates
# install gcc-9 and g++-9
apt-get install -y software-properties-common && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update -y && \
apt-get install -y gcc-9 g++-9 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
# install latest cmake
apt update && \
apt install -y software-properties-common lsb-release && \
apt clean all && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt update && \
apt install kitware-archive-keyring && \
rm /etc/apt/trusted.gpg.d/kitware.gpg && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF7F09730B3F0A4 && \
apt update && \
apt install -y cmake && \
apt clean all
export PKG_DIR=/opt/packages
export NPROC=4
echo "Installing Open MPI"
export OMPI_VERSOIN_MAJOR=3.0
export OMPI_VERSION_FULL=3.0.1
export OMPI_URL="https://download.open-mpi.org/release/open-mpi/v$OMPI_VERSOIN_MAJOR/openmpi-$OMPI_VERSION_FULL.tar.gz"
mkdir -p /tmp/ompi
mkdir -p /opt
# Download
cd /tmp/ompi && wget -O openmpi-$OMPI_VERSION_FULL.tar.gz $OMPI_URL && tar -xvf openmpi-$OMPI_VERSION_FULL.tar.gz
# Compile and install
cd /tmp/ompi/openmpi-$OMPI_VERSION_FULL && ./configure --prefix=$PKG_DIR && make -j$NPROC && make install
# Set env variables so we can compile our application
export PATH=$PKG_DIR/bin:$PATH
export LD_LIBRARY_PATH=$PKG_DIR/lib:$LD_LIBRARY_PATH
export MANPATH=$PKG_DIR/share/man:$MANPATH
echo "openmpi installed."
echo "Compiling hdf5"
export HDF5_VERSION_MAJOR=1.13
export HDF5_VERSION_FULL=1.13.2
export HDF5_URL="https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-$HDF5_VERSION_MAJOR/hdf5-$HDF5_VERSION_FULL/src/hdf5-$HDF5_VERSION_FULL.tar.gz"
mkdir -p /tmp/hdf5
cd /tmp/hdf5 && wget -O hdf5-$HDF5_VERSION_FULL.tar.gz $HDF5_URL && tar -xvf hdf5-$HDF5_VERSION_FULL.tar.gz && cd hdf5-$HDF5_VERSION_FULL
tar -xvf hdf5-$HDF5_VERSION_FULL.tar.gz && cd hdf5-$HDF5_VERSION_FULL
CC=mpicc CXX=mpic++ ./configure --enable-parallel --enable-unsupported --enable-shared --enable-cxx --prefix=$PKG_DIR && make -j$NPROC && make install
echo "hdf5 installed."
cd /opt/TomoATT
mkdir -p build && cd build && rm -rf ./*
cmake .. -DCMAKE_PREFIX_PATH=$PKG_DIR
make -j$NPROC
echo "TomoATT installed."
%labels
Maintainer MasaruNagaso
Version v1.0

View File

@@ -0,0 +1,87 @@
Bootstrap: docker
From: ubuntu:16.04
%help
This is a test container.
%files
../../TomoATT /opt/TomoATT
%environment
export PKG_DIR=/opt/packages
export SINGULARITY_PKG_DIR=$PKG_DIR
export SINGULARITYENV_APPEND_PATH=$PKG_DIR/bin
export SINGULAIRTYENV_APPEND_LD_LIBRARY_PATH=$PKG_DIR/lib
export PATH=$PKG_DIR/bin:$PATH
export PATH=/opt/TomoATT/build/bin:$PATH
export LD_LIBRARY_PATH=$PKG_DIR/lib:$LD_LIBRARY_PATH
%post
echo "Installing required packages..."
apt-get update && apt-get install -y wget git bash gcc gfortran g++ make file apt-transport-https ca-certificates
# install gcc-9 and g++-9
apt-get install -y software-properties-common && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update -y && \
apt-get install -y gcc-9 g++-9 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
# install latest cmake
apt update && \
apt install -y software-properties-common lsb-release && \
apt clean all && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt update && \
apt install kitware-archive-keyring && \
rm /etc/apt/trusted.gpg.d/kitware.gpg && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF7F09730B3F0A4 && \
apt update && \
apt install -y cmake && \
apt clean all
export PKG_DIR=/opt/packages
export NPROC=4
echo "Installing Open MPI"
export OMPI_VERSOIN_MAJOR=3.0
export OMPI_VERSION_FULL=3.0.1
export OMPI_URL="https://download.open-mpi.org/release/open-mpi/v$OMPI_VERSOIN_MAJOR/openmpi-$OMPI_VERSION_FULL.tar.gz"
mkdir -p /tmp/ompi
mkdir -p /opt
# Download
cd /tmp/ompi && wget -O openmpi-$OMPI_VERSION_FULL.tar.gz $OMPI_URL && tar -xvf openmpi-$OMPI_VERSION_FULL.tar.gz
# Compile and install
cd /tmp/ompi/openmpi-$OMPI_VERSION_FULL && ./configure --prefix=$PKG_DIR && make -j$NPROC && make install
# Set env variables so we can compile our application
export PATH=$PKG_DIR/bin:$PATH
export LD_LIBRARY_PATH=$PKG_DIR/lib:$LD_LIBRARY_PATH
export MANPATH=$PKG_DIR/share/man:$MANPATH
echo "openmpi installed."
echo "Compiling hdf5"
export HDF5_VERSION_MAJOR=1.13
export HDF5_VERSION_FULL=1.13.2
export HDF5_URL="https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-$HDF5_VERSION_MAJOR/hdf5-$HDF5_VERSION_FULL/src/hdf5-$HDF5_VERSION_FULL.tar.gz"
mkdir -p /tmp/hdf5
cd /tmp/hdf5 && wget -O hdf5-$HDF5_VERSION_FULL.tar.gz $HDF5_URL && tar -xvf hdf5-$HDF5_VERSION_FULL.tar.gz && cd hdf5-$HDF5_VERSION_FULL
tar -xvf hdf5-$HDF5_VERSION_FULL.tar.gz && cd hdf5-$HDF5_VERSION_FULL
CC=mpicc CXX=mpic++ ./configure --enable-parallel --enable-unsupported --enable-shared --enable-cxx --prefix=$PKG_DIR && make -j$NPROC && make install
echo "hdf5 installed."
cd /opt/TomoATT
mkdir -p build && cd build && rm -rf ./*
cmake .. -DUSE_CUDA=True -DCMAKE_PREFIX_PATH=$PKG_DIR
make -j$NPROC
echo "TomoATT installed."
%labels
Maintainer MasaruNagaso
Version v1.0