add container definitions for Fedora 36 and Ubuntu 22.04LTS

This commit is contained in:
Axel Kohlmeyer
2022-04-25 13:05:43 -04:00
parent 960d3faa5e
commit 8679266db8
2 changed files with 274 additions and 0 deletions

View File

@ -0,0 +1,125 @@
BootStrap: docker
From: fedora:36
%post
dnf -y update
dnf -y install vim-enhanced git file make cmake patch which file Lmod \
ninja-build clang clang-tools-extra libomp-devel libubsan libasan libtsan \
diffutils dos2unix findutils rsync python-devel libjpeg-devel libpng-devel \
ccache gcc-c++ gcc-gfortran gdb valgrind eigen3-devel openblas-devel \
openmpi-devel mpich-devel fftw-devel voro++-devel gsl-devel hdf5-devel \
netcdf-devel netcdf-cxx-devel netcdf-mpich-devel netcdf-openmpi-devel \
readline-devel python3-pyyaml python3-Cython \
mingw-filesystem-base mingw32-nsis mingw-binutils-generic \
mingw32-filesystem mingw32-pkg-config \
mingw64-filesystem mingw64-pkg-config \
mingw32-crt mingw32-headers mingw32-binutils \
mingw64-crt mingw64-headers mingw64-binutils \
mingw32-cpp mingw32-gcc mingw32-gcc-gfortran mingw32-gcc-c++ \
mingw64-cpp mingw64-gcc mingw64-gcc-gfortran mingw64-gcc-c++ \
mingw32-libgomp mingw64-libgomp \
mingw32-winpthreads mingw64-winpthreads \
mingw32-eigen3 mingw64-eigen3 \
mingw32-fftw mingw64-fftw \
mingw32-libjpeg-turbo mingw64-libjpeg-turbo \
mingw32-libpng mingw64-libpng \
mingw32-python3 mingw64-python3 \
mingw32-python3-numpy mingw64-python3-numpy \
mingw32-python3-pyyaml mingw64-python3-pyyaml \
mingw32-python3-setuptools mingw64-python3-setuptools \
mingw32-readline mingw64-readline \
mingw32-termcap mingw64-termcap \
mingw32-zlib mingw64-zlib \
mingw32-zstd mingw64-zstd \
enchant python3-virtualenv doxygen latexmk \
texlive-latex-fonts texlive-pslatex texlive-collection-latexrecommended \
texlive-latex texlive-latexconfig doxygen-latex texlive-collection-latex \
texlive-latex-bin texlive-lualatex-math texlive-fncychap texlive-tabulary \
texlive-framed texlive-wrapfig texlive-upquote texlive-capt-of \
texlive-needspace texlive-titlesec texlive-anysize texlive-dvipng texlive-xindy \
blas-devel lapack-devel libyaml-devel openkim-models kim-api-devel \
zstd libzstd-devel yaml-cpp-devel
dnf clean all
# enable Lmod and load MPI
source /usr/share/lmod/lmod/init/profile
module purge
module load mpi
# manually install Plumed
mkdir plumed
cd plumed
version=2.7.4
curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz
tar -xzf plumed.tar.gz
cd plumed-${version}
./configure --disable-doc --prefix=/usr
make
make install
# fix up installation for CentOS and Fedora
mv -v /usr/lib64/pkgconfig/plumed* /usr/share/pkgconfig/
cd ../../
rm -rvf plumed
# create missing termcap pkgconfig files
cat > /usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig/termcap.pc <<EOF
prefix=/usr/i686-w64-mingw32/sys-root/mingw
exec_prefix=/usr/i686-w64-mingw32/sys-root/mingw
libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib
includedir=/usr/i686-w64-mingw32/sys-root/mingw/include
Name: Termcap
Description: GNU/MinGW terminal feature database
URL: ftp://ftp.gnu.org/gnu/termcap/
Version: 1.3
Libs: -L\${libdir} -ltermcap
Cflags:
EOF
cat > /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/termcap.pc <<EOF
prefix=/usr/x86_64-w64-mingw32/sys-root/mingw
exec_prefix=/usr/x86_64-w64-mingw32/sys-root/mingw
libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib
includedir=/usr/x86_64-w64-mingw32/sys-root/mingw/include
Name: Termcap
Description: GNU/MinGW terminal feature database
URL: ftp://ftp.gnu.org/gnu/termcap/
Version: 1.3
Libs: -L\${libdir} -ltermcap
Cflags:
EOF
# set custom prompt indicating the container name
CUSTOM_PROMPT_ENV=/.singularity.d/env/99-zz_custom_prompt.sh
cat >$CUSTOM_PROMPT_ENV <<EOF
#!/bin/bash
PS1="[fedora36:\u@\h] \W> "
EOF
chmod 755 $CUSTOM_PROMPT_ENV
%environment
# we need to reset any module variables
# inherited from the host.
unset __LMOD_REF_COUNT__LMFILES_
unset __LMOD_REF_COUNT_PATH
unset __LMOD_REF_COUNT_LD_LIBRARY_PATH
unset __LMOD_REF_COUNT_MANPATH
unset __LMOD_REF_COUNT_MODULEPATH
unset __LMOD_REF_COUNT_LOADEDMODULES
unset _LMFILES_
unset MODULEPATH
unset MODULESHOME
unset MODULEPATH_ROOT
unset LOADEDMODULES
unset LMOD_SYSTEM_DEFAULT_MODULES
# load MPI by default
. /etc/profile
module load mpi
# tell OpenMPI to not try using Infiniband
OMPI_MCA_btl="^openib"
# do not warn about unused components as this messes up testing
OMPI_MCA_btl_base_warn_component_unused="0"
export OMPI_MCA_btl OMPI_MCA_btl_base_warn_component_unused
%labels
Author akohlmey, rbberger

View File

@ -0,0 +1,149 @@
BootStrap: docker
From: ubuntu:22.04
%post
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install --no-install-recommends -y software-properties-common
# add-apt-repository ppa:openkim/latest
apt-get update
apt-get upgrade --no-install-recommends -y
apt-get install --no-install-recommends -y \
bc \
build-essential \
ccache \
clang \
cmake \
cmake-curses-gui \
curl \
doxygen \
enchant-2 \
g++ \
gcc \
gfortran \
git \
hdf5-tools \
less \
libblas-dev \
libeigen3-dev \
libenchant-2-dev \
libfftw3-dev \
libgsl-dev \
libhdf5-serial-dev \
libhwloc-dev \
libjpeg-dev \
liblapack-dev \
libnetcdf-dev \
libomp-dev \
libopenblas-dev \
libnuma-dev \
libpng-dev \
libproj-dev \
libreadline-dev \
libvtk9-dev \
libyaml-dev \
libzstd-dev \
make \
mpi-default-bin \
mpi-default-dev \
ninja-build \
python3-dev \
python3-pip \
python3-pkg-resources \
python3-setuptools \
python3-virtualenv \
python3-venv \
rsync \
ssh \
texlive \
texlive-latex-recommended \
texlive-formats-extra \
texlive-pictures \
texlive-publishers \
texlive-science \
dvipng \
latexmk \
xindy \
vim-nox \
virtualenv \
voro++-dev \
wget \
xxd \
valgrind \
gdb \
zstd \
libyaml-cpp-dev \
libkim-api-dev \
gpg-agent \
# openkim-models
# ###########################################################################
# # KIM-API
# ###########################################################################
#
# # workaround for installing files in /usr/share/doc inside of a container
# sed -i 's/path-exclude=\/usr\/share\/doc/#path-exclude=\/usr\/share\/doc/g' /etc/dpkg/dpkg.cfg.d/excludes
# apt-get install -y libkim-api-doc
# sed -i 's/#path-exclude=\/usr\/share\/doc/path-exclude=\/usr\/share\/doc/g' /etc/dpkg/dpkg.cfg.d/excludes
#
# # install KIM models
# KIM_API_EXAMPLES=/usr/share/doc/libkim-api-dev/examples
# gunzip $KIM_API_EXAMPLES/portable-models/LennardJones612_UniversalShifted__MO_959249795837_003/LennardJones612_UniversalShifted.params.gz
# gunzip $KIM_API_EXAMPLES/model-drivers/ex_model_driver_P_LJ/ex_model_driver_P_LJ.f90.gz
#
# kim-api-collections-management install system $KIM_API_EXAMPLES/model-drivers/LennardJones612__MD_414112407348_003
# kim-api-collections-management install system $KIM_API_EXAMPLES/model-drivers/ex_model_driver_P_LJ
# kim-api-collections-management install system $KIM_API_EXAMPLES/portable-models/LennardJones_Ar
# kim-api-collections-management install system $KIM_API_EXAMPLES/portable-models/ex_model_Ar_P_LJ
# kim-api-collections-management install system $KIM_API_EXAMPLES/portable-models/LennardJones612_UniversalShifted__MO_959249795837_003
# kim-api-collections-management install system $KIM_API_EXAMPLES/simulator-models/Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu
###########################################################################
# Plumed
###########################################################################
export PLUMED_PKG_VERSION=2.7.4
mkdir plumed
cd plumed
curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${PLUMED_PKG_VERSION}/plumed-src-${PLUMED_PKG_VERSION}.tgz
tar -xzf plumed.tar.gz
cd plumed-${PLUMED_PKG_VERSION}
./configure --disable-doc --prefix=/usr
make
make install
cd ../../
rm -rvf plumed
###########################################################################
# Customizations
###########################################################################
# set custom prompt indicating the container name
CUSTOM_PROMPT_ENV=/.singularity.d/env/99-zz_custom_prompt.sh
cat >$CUSTOM_PROMPT_ENV <<EOF
#!/bin/bash
PS1="[ubuntu22.04:\u@\h] \W> "
EOF
chmod 755 $CUSTOM_PROMPT_ENV
###########################################################################
# Cleanup
###########################################################################
# clean cache
rm -rf /var/lib/apt/lists/*
%environment
LC_ALL=C
export LC_ALL
export PATH=/usr/lib/ccache:$PATH
# tell OpenMPI to not try using Infiniband
OMPI_MCA_btl="^openib"
# do not warn about unused components as this messes up testing
OMPI_MCA_btl_base_warn_component_unused="0"
export OMPI_MCA_btl OMPI_MCA_btl_base_warn_component_unused
%labels
Author akohlmey, rbberger