Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singularity #215

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ src/MarDyn_*.*
*.a
*.so
doxygen_doc/
tools/singularity/**/*.sif
10 changes: 10 additions & 0 deletions tools/singularity/centos/base-system.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bootstrap: library
from: centos:8

%post
dnf makecache
dnf -y install filesystem
dnf -y install gcc-toolset-10-gcc gcc-toolset-10-gcc-c++ gcc-toolset-10-gdb
# can't get this to work...
#echo \#\!/bin/bash > /etc/profile.d/gcc10.sh
#echo source scl_source enable gcc-toolset-10 >> /etc/profile.d/gcc10.sh
10 changes: 10 additions & 0 deletions tools/singularity/centos/devenv.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bootstrap: localimage
from: base.sif
stage: build

%post
dnf -y install mpich mpich-devel
dnf -y install cmake git libuuid-devel ncurses-devel
dnf -y --enablerepo=powertools install ninja-build
# only for interactive debugging, disable later
dnf -y install nano
65 changes: 65 additions & 0 deletions tools/singularity/centos/ls1-megamol.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
bootstrap: localimage
from: devenv.sif
stage: build

%files
# ../../../ls1-mardyn/cmake/ /tmp/ls1-mardyn/cmake/
# ../../../ls1-mardyn/src/ /tmp/ls1-mardyn/src/
# ../../../ls1-mardyn/CMakeLists.txt /tmp/ls1-mardyn/CMakeLists.txt

%post
LS1_URL="https://github.com/reinago/ls1-mardyn.git"
LS1_BRANCH="master"
MEGAMOL_URL="https://github.com/reinago/megamol.git"
MEGAMOL_BRANCH="fs_x"
OSPRAY_URL="https://github.com/ospray/ospray.git"
OSPRAY_BRANCH="v2.8.0"
MY_BUILD_CONFIG="Release"
MY_PREFIX="/opt"
MY_BUILDENV="${HOME}/tmp"
# replaced by devenv intermediate container
# dnf -y install mpich mpich-devel
# dnf -y install cmake git libuuid-devel ncurses-devel
# dnf -y --enablerepo=powertools install ninja-build
# # only for interactive debugging, disable later
# dnf -y install nano

source scl_source enable gcc-toolset-10
mkdir -p ${MY_PREFIX}
mkdir -p ${MY_BUILDENV}

# ls1
export CFLAGS=-I/usr/include/mpich-x86_64
export CXXFLAGS=-I/usr/include/mpich-x86_64
cd ${MY_BUILDENV}
git clone --depth 1 --branch ${LS1_BRANCH} ${LS1_URL}
cd ls1-mardyn
cmake -B build -D ENABLE_MPI=ON -D CMAKE_INSTALL_PREFIX=${MY_PREFIX}/ls1 -D CMAKE_C_COMPILER=/usr/lib64/mpich/bin/mpicc -D CMAKE_CXX_COMPILER=/usr/lib64/mpich/bin/mpic++
cmake --build build --config ${MY_BUILD_CONFIG} -- -j
# this would work but does nothing currently
# cmake --install build --config ${MY_BUILD_CONFIG}

export PATH=/usr/lib64/mpich/bin:$PATH

# MegaMol half-build to fetch TBB
cd ${MY_BUILDENV}
git clone --depth 1 --branch ${MEGAMOL_BRANCH} ${MEGAMOL_URL}
cd megamol
cmake -G Ninja -B build -D ENABLE_MPI=ON -D MPI_GUESS_LIBRARY_NAME= -D ENABLE_GL=OFF -D CMAKE_INSTALL_PREFIX=${MY_PREFIX}/megamol -D CMAKE_MPI_C_COMPILER=gcc -D CMAKE_MPI_CXX_COMPILER=g++
cmake --build build --config ${MY_BUILD_CONFIG}
cmake --install build --config ${MY_BUILD_CONFIG}

# OSPRay complete build, using MegaMol's TBB
cd ${MY_BUILDENV}
export TBB_ROOT=${MY_BUILDENV}/megamol/build/_deps/tbb-install
git clone --depth 1 --branch ${OSPRAY_BRANCH} ${OSPRAY_URL}
cd ospray
cmake -S scripts/superbuild -B build/super -D BUILD_GLFW=OFF -D BUILD_OSPRAY_APPS=OFF -D DOWNLOAD_TBB=OFF -D BUILD_EMBREE_FROM_SOURCE=OFF -D CMAKE_INSTALL_PREFIX=${MY_PREFIX}/ospray -D CMAKE_BUILD_TYPE=Release -G Ninja
cmake --build build/super --config ${MY_BUILD_CONFIG}
cmake --install build/super --config ${MY_BUILD_CONFIG}

# now full MegaMol with OSPRAY
cd ${MY_BUILDENV}/megamol
cmake -B build -D BUILD_PLUGIN_MMOSPRAY=ON -D ospray_DIR=${MY_PREFIX}/ospray/ospray/lib64/cmake/ospray-2.8.0/ -D rkcommon_DIR=${MY_PREFIX}/ospray/rkcommon/lib64/cmake/rkcommon-1.8.0/
cmake --build build --config ${MY_BUILD_CONFIG}
cmake --install build --config ${MY_BUILD_CONFIG}
7 changes: 7 additions & 0 deletions tools/singularity/ubuntu/base-system.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bootstrap: docker
from: ubuntu:20.04

%post
# this actually works in fakeroot
apt update && apt -y upgrade
apt -y install build-essential
11 changes: 11 additions & 0 deletions tools/singularity/ubuntu/devenv.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
bootstrap: localimage
from: base-system.sif
stage: build

%post
export DEBIAN_FRONTEND=noninteractive
apt -y install mpich
apt -y install cmake git uuid-dev libncurses-dev
apt -y install ninja-build
# only for interactive debugging, disable later
apt -y install nano
60 changes: 60 additions & 0 deletions tools/singularity/ubuntu/ls1-megamol.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
bootstrap: localimage
from: devenv.sif
stage: build

%files
# ../../../ls1-mardyn/cmake/ /tmp/ls1-mardyn/cmake/
# ../../../ls1-mardyn/src/ /tmp/ls1-mardyn/src/
# ../../../ls1-mardyn/CMakeLists.txt /tmp/ls1-mardyn/CMakeLists.txt

%post
LS1_URL="https://github.com/reinago/ls1-mardyn.git"
LS1_BRANCH="master"
MEGAMOL_URL="https://github.com/UniStuttgart-VISUS/megamol.git"
MEGAMOL_BRANCH="master"
OSPRAY_URL="https://github.com/ospray/ospray.git"
OSPRAY_BRANCH="v2.8.0"
MY_BUILD_CONFIG="Release"
MY_PREFIX="/opt"
MY_BUILDENV="${HOME}/tmp"

mkdir -p ${MY_PREFIX}
mkdir -p ${MY_BUILDENV}

# ls1

# export CFLAGS=-I/usr/include/mpich-x86_64
# export CXXFLAGS=-I/usr/include/mpich-x86_64
cd ${MY_BUILDENV}
git clone --depth 1 --branch ${LS1_BRANCH} ${LS1_URL}
cd ls1-mardyn
cmake -B build -D ENABLE_MPI=ON -D CMAKE_INSTALL_PREFIX=${MY_PREFIX}/ls1 -D CMAKE_C_COMPILER=/usr/bin/mpicc -D CMAKE_CXX_COMPILER=/usr/bin/mpic++
cmake --build build --config ${MY_BUILD_CONFIG} -- -j

# this would work but does nothing currently
# cmake --install build --config ${MY_BUILD_CONFIG}

# export PATH=/usr/lib64/mpich/bin:$PATH

# MegaMol half-build to fetch TBB
cd ${MY_BUILDENV}
git clone --depth 1 --branch ${MEGAMOL_BRANCH} ${MEGAMOL_URL}
cd megamol
cmake -G Ninja -B build -D ENABLE_MPI=ON -D MPI_GUESS_LIBRARY_NAME= -D ENABLE_GL=OFF -D CMAKE_INSTALL_PREFIX=${MY_PREFIX}/megamol -D CMAKE_MPI_C_COMPILER=gcc -D CMAKE_MPI_CXX_COMPILER=g++
cmake --build build --config ${MY_BUILD_CONFIG}
cmake --install build --config ${MY_BUILD_CONFIG}

# OSPRay complete build, using MegaMol's TBB
cd ${MY_BUILDENV}
export TBB_ROOT=${MY_BUILDENV}/megamol/build/_deps/tbb-install
git clone --depth 1 --branch ${OSPRAY_BRANCH} ${OSPRAY_URL}
cd ospray
cmake -S scripts/superbuild -B build/super -D BUILD_GLFW=OFF -D BUILD_OSPRAY_APPS=OFF -D DOWNLOAD_TBB=OFF -D BUILD_EMBREE_FROM_SOURCE=OFF -D CMAKE_INSTALL_PREFIX=${MY_PREFIX}/ospray -D CMAKE_BUILD_TYPE=Release -G Ninja
cmake --build build/super --config ${MY_BUILD_CONFIG}
cmake --install build/super --config ${MY_BUILD_CONFIG}

# now full MegaMol with OSPRAY
cd ${MY_BUILDENV}/megamol
cmake -B build -D BUILD_PLUGIN_MMOSPRAY=ON -D ospray_DIR=${MY_PREFIX}/ospray/ospray/lib/cmake/ospray-2.8.0/ -D rkcommon_DIR=${MY_PREFIX}/ospray/rkcommon/lib/cmake/rkcommon-1.8.0/
cmake --build build --config ${MY_BUILD_CONFIG}
cmake --install build --config ${MY_BUILD_CONFIG}