Skip to content
Open
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
16 changes: 13 additions & 3 deletions cmake/env/thisbdm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,10 @@ function source_thisbdm
else # GNU/Linux
# CentOS specifics (no longer officially supported)
set -l os_id (grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"'); or return 1
set -l os_proc_id (cat /proc/version); or return 1
if test "$os_id" = 'centos'
set -gx MESA_GL_VERSION_OVERRIDE "3.3"
if test -z "$CXX"; and test -z "$CC"
. scl_source enable devtoolset-10; or return 1
end


. /etc/profile.d/modules.sh; or return 1
module load mpi; or return 1
Expand All @@ -436,7 +435,18 @@ function source_thisbdm
if test -d "$BDMSYS"/third_party/libroadrunner
. scl_source enable llvm-toolset-7; or return 1
end

end
if string match -iq '*Red Hat*' -- $os_proc_id
. scl_source enable gcc-toolset-10 ^ /dev/null ^& /dev/null or true
. scl_source enable devtoolset-10 ^ /dev/null ^& /dev/null or true
. scl_source enable gcc-toolset-11 ^ /dev/null ^& /dev/null or true
. scl_source enable devtoolset-11 ^ /dev/null ^& /dev/null or true

. /etc/profile.d/modules.sh or return 1
module load mpi or return 1
end

end
#######

Expand Down
19 changes: 13 additions & 6 deletions cmake/env/thisbdm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -551,19 +551,26 @@ _source_thisbdm()
# CentOS specifics (no longer officially supported)
local os_id
os_id=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') || return 1
os_proc_id=$(cat /proc/version) || return 1

if [ "$os_id" = 'centos' ]; then
export MESA_GL_VERSION_OVERRIDE=3.3
if [ -z "${CXX}" ] && [ -z "${CC}" ] ; then
. scl_source enable devtoolset-10 || return 1
fi
. /etc/profile.d/modules.sh || return 1
module load mpi || return 1

# load llvm 6 required for libroadrunner
if [ -d "${BDMSYS}"/third_party/libroadrunner ]; then
. scl_source enable llvm-toolset-7 || return 1
fi
fi
if echo "$os_proc_id" | grep -Eiq 'Red Hat'; then
. scl_source enable gcc-toolset-10 > /dev/null 2> /dev/null || true
. scl_source enable devtoolset-10 > /dev/null 2> /dev/null || true
. scl_source enable gcc-toolset-11 > /dev/null 2> /dev/null || true
. scl_source enable devtoolset-11 > /dev/null 2> /dev/null || true

. /etc/profile.d/modules.sh || return 1
module load mpi || return 1
fi


fi
#######

Expand Down
16 changes: 16 additions & 0 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,32 @@ function(detect_os)
set(DETECTED_OS_VERS "${BDM_OS}-${MACOS_VERSION}-${MACOS_ARCH}" PARENT_SCOPE)
else()
set(GET_OS_ID "echo $(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '\"')")
set(GET_OS_ID_PROC "echo $(cat /proc/version)")
set(GET_OS_VERSION "echo $(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '\"')")

execute_process(COMMAND bash -c "${GET_OS_ID}"
OUTPUT_VARIABLE DISTRO_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND bash -c "${GET_OS_ID_PROC}"
OUTPUT_VARIABLE DISTRO_NAME_PROC
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND bash -c "${GET_OS_VERSION}"
OUTPUT_VARIABLE DISTRO_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND arch
OUTPUT_VARIABLE DISTRO_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
set(BDM_OS "${DISTRO_NAME}-${DISTRO_VERSION}")
if(BDM_OS MATCHES "debian|mint|eepin")
set(BDM_OS "ubuntu-24.04")
elseif (BDM_OS MATCHES "buntu")
set(BDM_OS "ubuntu-${DISTRO_VERSION}")
if (BDM_OS MATCHES "buntu-24|buntu-25|buntu-26")
set(BDM_OS "ubuntu-24.04")
endif()
endif()
if(DISTRO_NAME_PROC MATCHES "Red Hat")
set(BDM_OS "centos-7")
endif()
set(DETECTED_OS "${BDM_OS}" PARENT_SCOPE)
set(DETECTED_ARCH "${DISTRO_ARCH}" PARENT_SCOPE)
if("${DISTRO_ARCH}" STREQUAL "aarch64")
Expand Down
6 changes: 6 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@ if [ $? != 0 ]; then
exit 1
fi

# Activate mpi on centos/rhel
if echo "$BDM_DETECTED_OS" | grep -Eiq 'centos|rhel'; then
. /etc/profile.d/modules.sh
module load mpi/openmpi-x86_64
fi

# call install script for the detected OS
$BDM_PROJECT_DIR/util/installation/common/install.sh ${BDM_DETECTED_OS}
1 change: 1 addition & 0 deletions src/core/exporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <memory>
#include <string>
#include <cstdint>

namespace bdm {

Expand Down
1 change: 1 addition & 0 deletions third_party/cxxopts-v2.2.1/cxxopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ THE SOFTWARE.
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <cstdint>
#include <vector>

#ifdef __cpp_lib_optional
Expand Down
18 changes: 17 additions & 1 deletion util/installation/common/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,23 @@ function DetectOs {
DISTRIBUTOR=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
RELEASE=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"')
OS="${DISTRIBUTOR}-${RELEASE}"
echo $OS | awk '{print tolower($0)}'
PROCVERSION=$(cat /proc/version)
if echo "$OS" | grep -Eiq 'debian|mint|eepin' ; then
OS="ubuntu-24.04"
elif echo "$DISTRIBUTOR" | grep -Eiq 'buntu' ; then
OS="ubuntu-${RELEASE}"
if echo "$OS" | grep -Eiq 'buntu-24|buntu-25|buntu-26' ; then
OS="ubuntu-24.04"
fi
elif echo "$PROCVERSION" | grep -Eiq 'Red Hat' ; then
if echo "$OS" | grep -Eiq 'centos-7'; then
OS="centos-7"
else
OS="rhel"
fi
fi
echo $OS | awk '{print tolower($0)}'

elif [ `uname` = "Darwin" ]; then
# macOS
echo osx
Expand Down
52 changes: 52 additions & 0 deletions util/installation/rhel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -----------------------------------------------------------------------------
#
# Copyright (C) 2021 CERN & University of Surrey for the benefit of the
# BioDynaMo collaboration. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# See the LICENSE file distributed with this work for details.
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# -----------------------------------------------------------------------------

FROM centos:7

# workaround for https://github.com/containers/buildah/issues/1046
RUN echo "" >> /etc/hosts && cat /etc/hosts && yum -y install setup

# man required by ROOT
# mesa-dri-drivers: OpenGl driver (software renderer)
RUN yum update -y && yum install -y \
git \
sudo \
man \
wget \
xorg-x11-server-Xvfb \
mesa-dri-drivers

RUN git config --system user.name "Test User" && \
git config --system user.email user@test.com

# update user id and group id such that mapped volumes can be accessed with the
# same rights as on the host. Files created by the container can also be
# accessed on the host without chowning.
ARG HOST_UID
ARG HOST_GID

RUN groupadd -g $HOST_GID testuser && \
useradd -u $HOST_UID -g $HOST_GID -m -c "Testuser" testuser && \
passwd --delete testuser && \
echo "testuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

USER testuser

# preserve the environment variable BDM_LOCAL_LFS when calling scripts with
# sudo
RUN echo "Defaults env_keep += \"BDM_LOCAL_LFS\"" | sudo tee -a /etc/sudoers

# the OpenGL capabilities can be incorrectly detected -> override version
# https://python.develop-bugs.com/article/10118323/paraview+needs+higher+OpenGL+in+Mesa
ENV MESA_GL_VERSION_OVERRIDE=3.3
25 changes: 25 additions & 0 deletions util/installation/rhel/package_list_extra
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
doxygen
graphviz
libxml2-devel
fontconfig-devel
fontconfig
freetype
freetype-devel
llvm-toolset-7
llvm-toolset-7-clang-tools-extra
llvm-toolset-7-llvm-devel
llvm-toolset-7-llvm-static
valgrind
gsl-devel
openssl-devel
pcre-devel
mesa-libGL-devel
mesa-libGLU-devel
cfitsio-devel
libldap-dev
python-devel
libXt-devel
freeglut3-devel
ncurses-devel


78 changes: 78 additions & 0 deletions util/installation/rhel/package_list_required
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
gcc
g++
gcc-gfortran
bzip2-devel
freeglut-devel
git
patch
libXext-devel
libXt-devel
numactl-devel
openmpi-devel
wget
zlib-devel
python3-tkinter
tk-devel

@development
gmp-devel
mpfr-devel
libmpc-devel
bzip2
readline-devel
sqlite
doxygen
sqlite-devel
openssl-devel
xz
xz-devel
libffi-devel
findutils
lapack-devel
blas-devel
llvm-toolset
openmpi
libX11-devel
libXpm-devel
libXft-devel
valgrind
gsl-devel
atlas-devel
pcre-devel
mesa-libGL-devel
mesa-libGLU-devel
glew-devel
ftgl-devel
mysql-devel
fftw-devel
cfitsio-devel
graphviz-devel
avahi-compat-libdns_sd-devel
libldap-devel
python-devel
libxml2-devel
gsl-static
libXt-devel
freeglut3-devel
ncurses-devel
openldap-devel
zlib
libuuid-devel
ffmpeg-free-devel
libxkbcommon-devel
libxkbcommon-x11-devel
xcb-util-devel
xcb-util-image-devel
xcb-util-keysyms-devel
xcb-util-xrm-devel
xcb-util-cursor-devel
xcb-util-renderutil-devel
xcb-util-wm-devel
libXi-devel
xcb-proto
tslib
tslib-devel
ncurses-compat-libs
devtoolset-10-gcc*
devtoolset-11-gcc*
gcc-toolset-11*
Loading
Loading