Skip to content

Instantly share code, notes, and snippets.

@mherkazandjian
Last active July 29, 2019 02:50
Show Gist options
  • Save mherkazandjian/148d476df130d325d80c2ddb5a8b50d4 to your computer and use it in GitHub Desktop.
Save mherkazandjian/148d476df130d325d80c2ddb5a8b50d4 to your computer and use it in GitHub Desktop.
Singularity recipe for creating a OpenFOAM 2.4 container based on ubuntu 14.04
BootStrap: debootstrap
OSVersion: trusty
MirrorURL: http://us.archive.ubuntu.com/ubuntu/
%post
sed -i 's/$/ universe/' /etc/apt/sources.list
apt-get update
apt-get clean
apt-get install -y --no-install-recommends locales
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen en_US.utf8
/usr/sbin/update-locale LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
apt-get install -y \
build-essential \
flex \
bison \
cmake \
zlib1g-dev \
libboost-system-dev \
libboost-thread-dev \
libopenmpi-dev \
openmpi-bin \
gnuplot \
libreadline-dev \
libncurses-dev \
libxt-dev
apt-get install -y openssh-server
apt-get install -y \
qt4-dev-tools \
libqt4-dev \
libqt4-opengl-dev \
freeglut3-dev \
libqtwebkit-dev
apt-get install -y libscotch-dev libcgal-dev
mkdir /opt/OpenFOAM
wget http://downloads.sourceforge.net/foam/OpenFOAM-2.4.0.tgz?use_mirror=mesh -O /opt/OpenFOAM/OpenFOAM-2.4.0.tgz
wget http://downloads.sourceforge.net/foam/ThirdParty-2.4.0.tgz?use_mirror=mesh -O /opt/OpenFOAM/ThirdParty-2.4.0.tgz
cd /opt/OpenFOAM
tar -xvf OpenFOAM-2.4.0.tgz
tar -xvf ThirdParty-2.4.0.tgz
sed -i.bak 's/foamInstall\=\$HOME\/\$WM_PROJECT/foamInstall\=\/opt\/\$WM_PROJECT/g' OpenFOAM-2.4.0/etc/bashrc
cd OpenFOAM-2.4.0
bash --rcfile etc/bashrc -ci ./Allwmake 2>&1 | tee wmakeAll.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment