diff --git a/.gitignore b/.gitignore index fce587059b..f538fded29 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ src/MarDyn_*.* *.a *.so doxygen_doc/ +tools/singularity/**/*.sif diff --git a/tools/singularity/centos/base-system.def b/tools/singularity/centos/base-system.def new file mode 100644 index 0000000000..f5fa5179e0 --- /dev/null +++ b/tools/singularity/centos/base-system.def @@ -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 \ No newline at end of file diff --git a/tools/singularity/centos/devenv.def b/tools/singularity/centos/devenv.def new file mode 100644 index 0000000000..25227a5895 --- /dev/null +++ b/tools/singularity/centos/devenv.def @@ -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 diff --git a/tools/singularity/centos/ls1-megamol.def b/tools/singularity/centos/ls1-megamol.def new file mode 100644 index 0000000000..ce9b58855b --- /dev/null +++ b/tools/singularity/centos/ls1-megamol.def @@ -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} diff --git a/tools/singularity/ubuntu/base-system.def b/tools/singularity/ubuntu/base-system.def new file mode 100644 index 0000000000..12a16ac507 --- /dev/null +++ b/tools/singularity/ubuntu/base-system.def @@ -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 \ No newline at end of file diff --git a/tools/singularity/ubuntu/devenv.def b/tools/singularity/ubuntu/devenv.def new file mode 100644 index 0000000000..1fe5809eab --- /dev/null +++ b/tools/singularity/ubuntu/devenv.def @@ -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 diff --git a/tools/singularity/ubuntu/ls1-megamol.def b/tools/singularity/ubuntu/ls1-megamol.def new file mode 100644 index 0000000000..0dc73171d0 --- /dev/null +++ b/tools/singularity/ubuntu/ls1-megamol.def @@ -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}