Skip to content

Instantly share code, notes, and snippets.

@panda1100
Last active March 2, 2023 05:50
Show Gist options
  • Save panda1100/5ee809e39e9f50c5c12a85c582e4c517 to your computer and use it in GitHub Desktop.
Save panda1100/5ee809e39e9f50c5c12a85c582e4c517 to your computer and use it in GitHub Desktop.
OpenFOAM v2212 PMI2
# ---------------------------------*-sh-*------------------------------------
# Yoshiaki Senda modified version
#
# Copyright (C) 2021-2022 OpenCFD Ltd.
# SPDX-License-Identifier: (GPL-3.0+)
#
# Example
# git clone https://develop.openfoam.com/packaging/containers.git
# cd containers/docker
# wget https://gist.githubusercontent.com/panda1100/5ee809e39e9f50c5c12a85c582e4c517/raw/openfoam2212-pmi2_rocky.def
# apptainer build --fakeroot openfoam2212.sif openfoam2212-pmi2_rocky.def
#
# ---------------------------------------------------------------------------
Bootstrap: docker
From: rockylinux/rockylinux:latest
Stage: build
%post
dnf -y group install "Development tools"
dnf -y install epel-release
dnf -y install 'dnf-command(config-manager)'
dnf -y config-manager --set-enabled powertools
dnf -y install wget
dnf -y install hwloc slurm-pmi slurm-pmi-devel
dnf -y clean all
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.gz
tar zxvf openmpi-4.1.4.tar.gz && rm openmpi-4.1.4.tar.gz
cd openmpi-4.1.4
./configure --with-hwloc=internal --prefix=/opt/openmpi/4.1.4 --with-slurm --with-pmi=/usr
make -j
make install
Bootstrap: docker
From: rockylinux/rockylinux:latest
Stage: runtime
%files from build
/opt/openmpi/4.1.4 /opt/openmpi/4.1.4
%files
openfoam-files.rc/* /openfoam/
%post
dnf -y install wget rsync \
passwd shadow-utils nss_wrapper
dnf -y install 'dnf-command(config-manager)'
dnf -y config-manager --set-enabled powertools
dnf -y install epel-release
dnf -y install 'dnf-command(copr)'
dnf -y copr enable openfoam/openfoam
dnf -y install openfoam2206
dnf -y clean all
%post
/bin/sh /openfoam/assets/post-install.sh -fix-perms -no-sudo
%post
dnf -y install slurm-pmi
dnf -y clean all
echo 'export MPI_ARCH_PATH=/opt/openmpi/4.1.4' > $(bash /openfoam/assets/query.sh -show-prefix)/etc/config.sh/prefs.sys-openmpi
%runscript
exec /openfoam/run "$@"
%labels
Author OpenCFD Ltd.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment