From 3a6c6b3bb0c3e41362c09e75f02fefe07ef1e485 Mon Sep 17 00:00:00 2001 From: john Papadopoulos Date: Sat, 26 Jul 2025 12:35:57 +0800 Subject: [PATCH 01/12] porting to debian_based_platforms --- cmake/utils.cmake | 5 +++++ util/installation/common/util.sh | 5 +++++ .../ubuntu-24.04/package_list_required | 19 ++++++++++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 2dd29ef4f..bce01dac4 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -41,6 +41,11 @@ function(detect_os) 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}") + endif() set(DETECTED_OS "${BDM_OS}" PARENT_SCOPE) set(DETECTED_ARCH "${DISTRO_ARCH}" PARENT_SCOPE) if("${DISTRO_ARCH}" STREQUAL "aarch64") diff --git a/util/installation/common/util.sh b/util/installation/common/util.sh index 45a53d168..dc32741a8 100755 --- a/util/installation/common/util.sh +++ b/util/installation/common/util.sh @@ -48,6 +48,11 @@ function DetectOs { DISTRIBUTOR=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') RELEASE=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"') OS="${DISTRIBUTOR}-${RELEASE}" + if echo "$OS" | grep -Eiq 'debian|mint|eepin' ; then + OS="ubuntu-24.04" + elif echo "$DISTRIBUTOR" | grep -Eiq 'buntu' ; then + OS="ubuntu-${RELEASE}" + fi echo $OS | awk '{print tolower($0)}' elif [ `uname` = "Darwin" ]; then # macOS diff --git a/util/installation/ubuntu-24.04/package_list_required b/util/installation/ubuntu-24.04/package_list_required index f2d9591b0..b213da132 100644 --- a/util/installation/ubuntu-24.04/package_list_required +++ b/util/installation/ubuntu-24.04/package_list_required @@ -1,10 +1,16 @@ +lsb-release curl +build-essential freeglut3-dev g++ gcc +gfortran g++-11 gcc-11 +gfortran-11 +patch git +doxygen libblas-dev libbz2-dev liblapack-dev @@ -16,15 +22,22 @@ libpthread-stubs0-dev make wget zlib1g-dev -python3-dev -libbz2-dev +graphviz-dev +libgsl-dev +valgrind libffi-dev liblzma-dev libreadline-dev libsqlite3-dev +libglew-dev libssl-dev python3-openssl +libatlas-base-dev tk-dev xz-utils -zlib1g-dev +uuid-dev +python3-dev +libldap-dev +libcfitsio-dev +libncurses-dev From d53fe4d8bbf42cc86b3ddc62d612b68037cda17e Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sat, 26 Jul 2025 08:37:12 +0000 Subject: [PATCH 02/12] Update utils.cmake added prelimitary support for ubuntu 25 and 26 --- cmake/utils.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index bce01dac4..b1da584eb 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -41,10 +41,13 @@ function(detect_os) 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") + 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() set(DETECTED_OS "${BDM_OS}" PARENT_SCOPE) set(DETECTED_ARCH "${DISTRO_ARCH}" PARENT_SCOPE) From a4c92971854cb81a2f0ae8613fb8fb3b3d0b5cf5 Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sat, 26 Jul 2025 08:40:30 +0000 Subject: [PATCH 03/12] Update util.sh added preliminary support for ubuntu 24.10, 25 and 26 --- util/installation/common/util.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/installation/common/util.sh b/util/installation/common/util.sh index dc32741a8..bfeb657ed 100755 --- a/util/installation/common/util.sh +++ b/util/installation/common/util.sh @@ -52,6 +52,9 @@ function DetectOs { 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 fi echo $OS | awk '{print tolower($0)}' elif [ `uname` = "Darwin" ]; then From 3428b0c8832e38839f8f776ed7ca059849fe96ed Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sat, 26 Jul 2025 08:42:00 +0000 Subject: [PATCH 04/12] Update util.sh --- util/installation/common/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/installation/common/util.sh b/util/installation/common/util.sh index bfeb657ed..212bc0a7b 100755 --- a/util/installation/common/util.sh +++ b/util/installation/common/util.sh @@ -52,7 +52,7 @@ function DetectOs { 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 + if echo "$OS" | grep -Eiq 'buntu-24|buntu-25|buntu-26' ; then OS="ubuntu-24.04" fi fi From cbdea7e2bcad1134f8f37229e89b428cc235fcd5 Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sat, 26 Jul 2025 11:06:01 +0000 Subject: [PATCH 05/12] Update package_list_required Removed libatlas-base-dev unneeded dependency in order to support ubuntu 25.10 --- util/installation/ubuntu-24.04/package_list_required | 1 - 1 file changed, 1 deletion(-) diff --git a/util/installation/ubuntu-24.04/package_list_required b/util/installation/ubuntu-24.04/package_list_required index b213da132..f0d04c605 100644 --- a/util/installation/ubuntu-24.04/package_list_required +++ b/util/installation/ubuntu-24.04/package_list_required @@ -32,7 +32,6 @@ libsqlite3-dev libglew-dev libssl-dev python3-openssl -libatlas-base-dev tk-dev xz-utils uuid-dev From b4ad6ec4bf2a30f9dba080969dfb75dae4626bee Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sat, 4 Oct 2025 19:27:32 +0300 Subject: [PATCH 06/12] #include for gcc 15 --- src/core/exporter.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/exporter.h b/src/core/exporter.h index f706b191b..69f0138c4 100644 --- a/src/core/exporter.h +++ b/src/core/exporter.h @@ -17,6 +17,7 @@ #include #include +#include namespace bdm { From a1be7fe46684e75d79d771b474f517f9a32b878a Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sat, 4 Oct 2025 19:28:51 +0300 Subject: [PATCH 07/12] #include for gcc 15 --- third_party/cxxopts-v2.2.1/cxxopts.h | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/cxxopts-v2.2.1/cxxopts.h b/third_party/cxxopts-v2.2.1/cxxopts.h index 6d230f062..0db88ce3b 100644 --- a/third_party/cxxopts-v2.2.1/cxxopts.h +++ b/third_party/cxxopts-v2.2.1/cxxopts.h @@ -37,6 +37,7 @@ THE SOFTWARE. #include #include #include +#include #include #ifdef __cpp_lib_optional From 240d1edd352c174558da84ca21782fbd1049d49f Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sat, 4 Oct 2025 19:30:19 +0300 Subject: [PATCH 08/12] Removed some non required packages --- util/installation/ubuntu-24.04/package_list_required | 4 ---- 1 file changed, 4 deletions(-) diff --git a/util/installation/ubuntu-24.04/package_list_required b/util/installation/ubuntu-24.04/package_list_required index f0d04c605..1227e44a5 100644 --- a/util/installation/ubuntu-24.04/package_list_required +++ b/util/installation/ubuntu-24.04/package_list_required @@ -1,13 +1,9 @@ -lsb-release curl build-essential freeglut3-dev g++ gcc gfortran -g++-11 -gcc-11 -gfortran-11 patch git doxygen From 923914076184cd922fb76b03ae8af94910e21b1c Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sun, 5 Oct 2025 00:30:13 +0300 Subject: [PATCH 09/12] Recovered gcc-11 --- util/installation/ubuntu-24.04/package_list_required | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/installation/ubuntu-24.04/package_list_required b/util/installation/ubuntu-24.04/package_list_required index 1227e44a5..6abeb6630 100644 --- a/util/installation/ubuntu-24.04/package_list_required +++ b/util/installation/ubuntu-24.04/package_list_required @@ -4,6 +4,9 @@ freeglut3-dev g++ gcc gfortran +g++-11 +gcc-11 +gfortran-11 patch git doxygen From 0aa343b67b3a3be3040cc1f8ee4809f39f53d2d1 Mon Sep 17 00:00:00 2001 From: johnpapad24 <92296237+johnpapad24@users.noreply.github.com> Date: Sat, 4 Oct 2025 22:41:09 -0700 Subject: [PATCH 10/12] Update prerequisites.sh One by one package installation for failsafe reasons. installing cmake after curl --- util/installation/ubuntu-24.04/prerequisites.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/util/installation/ubuntu-24.04/prerequisites.sh b/util/installation/ubuntu-24.04/prerequisites.sh index a3ea706cb..dd0178792 100755 --- a/util/installation/ubuntu-24.04/prerequisites.sh +++ b/util/installation/ubuntu-24.04/prerequisites.sh @@ -40,16 +40,18 @@ sudo apt-get install apt-transport-https # Update sudo apt-get update +# Install required packages +while read -r package; do + sudo apt-get install -y "$package" +done < $BDM_PROJECT_DIR/util/installation/ubuntu-24.04/package_list_required + +# Install CMAKE CMAKE_VER=3.19.3 CMAKE_SH="cmake-${CMAKE_VER}-linux-x86_64.sh" curl -L -O https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/${CMAKE_SH} sudo bash "${CMAKE_SH}" --prefix=/usr/local --skip-license rm "${CMAKE_SH}" -# Install required packages -sudo apt-get install -y \ - $(cat $BDM_PROJECT_DIR/util/installation/ubuntu-24.04/package_list_required) - if [ -n "${PYENV_ROOT}" ]; then unset PYENV_ROOT fi @@ -80,8 +82,10 @@ if [ $1 == "all" ]; then # Don't install --user: the packages should end up in the PYENV_ROOT directory python -m pip install -r $BDM_PROJECT_DIR/util/installation/ubuntu-24.04/pip_packages.txt - sudo apt-get install -y \ - $(cat $BDM_PROJECT_DIR/util/installation/ubuntu-24.04/package_list_extra) +while read -r package; do + sudo apt-get install -y "$package" +done < $BDM_PROJECT_DIR/util/installation/ubuntu-24.04/package_list_extra + fi exit 0 From 6ce3db75e786e5ee7ce3ddbd9936892a7c7285a1 Mon Sep 17 00:00:00 2001 From: John Papadopoulos Date: Mon, 6 Oct 2025 18:10:21 +0300 Subject: [PATCH 11/12] porting biodynamo to rhel fedora --- util/installation/rhel/Dockerfile | 52 ++++++++ util/installation/rhel/package_list_extra | 25 ++++ util/installation/rhel/package_list_required | 78 ++++++++++++ util/installation/rhel/prerequisites.sh | 127 +++++++++++++++++++ 4 files changed, 282 insertions(+) create mode 100644 util/installation/rhel/Dockerfile create mode 100644 util/installation/rhel/package_list_extra create mode 100644 util/installation/rhel/package_list_required create mode 100755 util/installation/rhel/prerequisites.sh diff --git a/util/installation/rhel/Dockerfile b/util/installation/rhel/Dockerfile new file mode 100644 index 000000000..45e68264f --- /dev/null +++ b/util/installation/rhel/Dockerfile @@ -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 diff --git a/util/installation/rhel/package_list_extra b/util/installation/rhel/package_list_extra new file mode 100644 index 000000000..b32375ade --- /dev/null +++ b/util/installation/rhel/package_list_extra @@ -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 + + diff --git a/util/installation/rhel/package_list_required b/util/installation/rhel/package_list_required new file mode 100644 index 000000000..43f4cb1bd --- /dev/null +++ b/util/installation/rhel/package_list_required @@ -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* diff --git a/util/installation/rhel/prerequisites.sh b/util/installation/rhel/prerequisites.sh new file mode 100755 index 000000000..d2d2ace23 --- /dev/null +++ b/util/installation/rhel/prerequisites.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# +# 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. +# +# ----------------------------------------------------------------------------- + +# This script installs the required packages +if [[ $# -ne 1 ]]; then + echo "ERROR: Wrong number of arguments. +Description: + This script installs the prerequisites of BioDynaMo, but not BioDynaMo + itself. Script install.sh installs both prerequisites and BioDynaMo. +Arguments: + all/required. If all is specified, then this script + will install all the prerequisites." + exit 1 +fi + +BDM_PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../.." + +sudo -v + + +sudo yum update -y + +# Install repositories + +sudo yum config-manager --enable *codeready* + +sudo yum config-manager --enable *crb* + +sudo yum config-manager --enable *powertools* + +sudo yum config-manager --enable *extras* + +sudo subscription-manager repos --enable *powertools* + +sudo subscription-manager repos --enable *codeready* + +sudo subscription-manager repos --disable "codeready-builder-for-rhel-*-x86_64-eus*" + +sudo yum update -y + +sudo yum install -y --nogpgcheck --skip-broken epel-release + +if $( cat /etc/os-release | grep -q 'PRETTY_NAME="Red Hat Enterprise Linux 9"' ); then + sudo dnf install \ +https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +fi + +sudo yum update -y + + +# Install required packages + +if echo $(yum --version) | awk '{print $1}' | grep -Eiq 'dnf5' ; then + + sudo dnf install -y --nogpgcheck --skip-unavailable \ + $(cat $BDM_PROJECT_DIR/util/installation/rhel/package_list_required) + +else + + sudo yum install -y --nogpgcheck --skip-broken \ + $(cat $BDM_PROJECT_DIR/util/installation/rhel/package_list_required) + +fi + + +curl -L -O https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh +chmod +x cmake-3.19.3-Linux-x86_64.sh +sudo ./cmake-3.19.3-Linux-x86_64.sh --skip-license --prefix=/usr/local + +if [ -n "${PYENV_ROOT}" ]; then + unset PYENV_ROOT +fi + +# If PyEnv is not installed, install it +if [ ! -f "$HOME/.pyenv/bin/pyenv" ]; then + echo "PyEnv was not found. Installing now..." + curl https://pyenv.run | bash +fi +export PYENV_ROOT="$HOME/.pyenv" +export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init --path)" +eval "$(pyenv init -)" +pyenv update + +PYVERS=3.9.1 + +# If Python $PYVERS is not installed, install it +if [ ! -f "$HOME/.pyenv/versions/$PYVERS/lib/libpython3.so" ]; then + echo "Python $PYVERS was not found. Installing now..." + /usr/bin/env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f $PYVERS +fi +pyenv shell $PYVERS + +# Install optional packages +if [ $1 == "all" ]; then + python -m pip install --upgrade pip + PIP_PACKAGES="markupsafe==2.0.1 nbformat jupyter metakernel jupyterlab nbformat==5.4.0 nbconvert==6.5.3 nbclient==0.6.6 setuptools cython" + # Don't install --user: the packages should end up in the PYENV_ROOT directory + python -m pip install $PIP_PACKAGES + # SBML integration + if echo $(yum --version) | awk '{print $1}' | grep -Eiq 'dnf5' ; then + + sudo dnf install -y --nogpgcheck --skip-unavailable \ + $(cat $BDM_PROJECT_DIR/util/installation/rhel/package_list_extra) + + else + + sudo yum install -y --nogpgcheck --skip-broken \ + $(cat $BDM_PROJECT_DIR/util/installation/rhel/package_list_extra) + + fi + +fi + +exit 0 From 298f2c7ae1cbff3ec6b048886ad6c653c33db63d Mon Sep 17 00:00:00 2001 From: John Papadopoulos Date: Mon, 6 Oct 2025 19:19:21 +0300 Subject: [PATCH 12/12] fixed bash and fish files --- cmake/env/thisbdm.fish | 16 +++++++++++++--- cmake/env/thisbdm.sh | 19 +++++++++++++------ cmake/utils.cmake | 8 ++++++++ install.sh | 6 ++++++ util/installation/common/util.sh | 10 +++++++++- 5 files changed, 49 insertions(+), 10 deletions(-) diff --git a/cmake/env/thisbdm.fish b/cmake/env/thisbdm.fish index 875851f88..d02f1b2da 100755 --- a/cmake/env/thisbdm.fish +++ b/cmake/env/thisbdm.fish @@ -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 @@ -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 ####### diff --git a/cmake/env/thisbdm.sh b/cmake/env/thisbdm.sh index 262165bc2..6aa2e2b7b 100755 --- a/cmake/env/thisbdm.sh +++ b/cmake/env/thisbdm.sh @@ -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 ####### diff --git a/cmake/utils.cmake b/cmake/utils.cmake index b1da584eb..2c59f6df2 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -31,10 +31,15 @@ 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) @@ -49,6 +54,9 @@ function(detect_os) 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") diff --git a/install.sh b/install.sh index 48fc19759..61f6f7532 100755 --- a/install.sh +++ b/install.sh @@ -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} diff --git a/util/installation/common/util.sh b/util/installation/common/util.sh index 212bc0a7b..5982c3f49 100755 --- a/util/installation/common/util.sh +++ b/util/installation/common/util.sh @@ -48,6 +48,7 @@ function DetectOs { DISTRIBUTOR=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') RELEASE=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"') OS="${DISTRIBUTOR}-${RELEASE}" + PROCVERSION=$(cat /proc/version) if echo "$OS" | grep -Eiq 'debian|mint|eepin' ; then OS="ubuntu-24.04" elif echo "$DISTRIBUTOR" | grep -Eiq 'buntu' ; then @@ -55,8 +56,15 @@ function DetectOs { 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 - echo $OS | awk '{print tolower($0)}' + fi + echo $OS | awk '{print tolower($0)}' + elif [ `uname` = "Darwin" ]; then # macOS echo osx