diff --git a/.github/workflows/almalinux-ci.yml b/.github/workflows/almalinux-ci.yml new file mode 100644 index 000000000..dc387b5d0 --- /dev/null +++ b/.github/workflows/almalinux-ci.yml @@ -0,0 +1,102 @@ +name: AlmaLinux CI + +on: + push: + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + container: + image: almalinux:9.5 + + steps: + - name: Install dependencies + run: | + dnf -y update + dnf -y --enablerepo=crb install epel-release + dnf -y --enablerepo=crb install \ + lsb_release cmake git gcc g++ wget man make ninja-build \ + bzip2-devel freeglut-devel libXext-devel libXt-devel libXpm-devel \ + libXft-devel numactl-devel openmpi-devel zlib-devel lapack-devel \ + blas-devel readline-devel sqlite-devel openssl-devel xz-devel \ + libffi-devel findutils patch which perl-Digest-SHA \ + xorg-x11-server-Xvfb fontconfig mesa-dri-drivers + + - name: Start Xvfb + run: | + set -e + XVFBARGS=":99 -ac -screen 0 2560x1440x24" + /usr/bin/Xvfb $XVFBARGS >> /tmp/Xvfb.out 2>&1 & + disown -ar + sleep 3 + + - name: Set OSVERS + run: | + ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') + VERSION=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"') + echo "OSVERS=$ID-$VERSION" >> $GITHUB_ENV + + - name: Cache pyenv + uses: actions/cache@v4 + id: pyenv-cache + with: + path: ~/.pyenv + key: ${{ env.OSVERS }}-pyenv-3.9.1 + + - name: Install pyenv dependency + if: steps.pyenv-cache.outputs.cache-hit != 'true' + run: | + if [ ! -f "$HOME/.pyenv/bin/pyenv" ]; then + curl https://pyenv.run | bash + fi + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init --path)" + eval "$(pyenv init -)" + PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.1 + pyenv shell 3.9.1 + + - name: Checkout BioDynaMo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cache Third Party Packages + uses: actions/cache@v4 + with: + path: build/third_party + key: ${{ env.OSVERS }}-third-party-${{ hashFiles('cmake/external/SHA256Digests.cmake') }} + + - name: Build BioDynaMo + shell: bash + run: | + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init --path)" + eval "$(pyenv init -)" + pyenv shell 3.9.1 + . /etc/profile.d/modules.sh || true + module load mpi + cmake -G Ninja \ + -Dparaview=OFF \ + -Dbenchmark=ON \ + -Dlibgit2=ON \ + -Dnuma=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -B build + cmake --build build --parallel --config Release + + - name: Unit tests BioDynaMo + shell: bash + working-directory: build + run: | + . bin/thisbdm.sh + bdm config + export DISPLAY=:99.0 + sleep 3 + ninja run-unit-tests diff --git a/.github/workflows/almalinux-system-ci.yml b/.github/workflows/almalinux-system-ci.yml new file mode 100644 index 000000000..04dcbd0be --- /dev/null +++ b/.github/workflows/almalinux-system-ci.yml @@ -0,0 +1,161 @@ +# Runs the installation tests and valgrind tests in the following cases: +# 1) every day at 3 am +# 2) a pull request to the master branch + +name: AlmaLinux System CI + +on: + schedule: + # Every day at 3 am + - cron: '0 3 * * *' + pull_request: + # Upon pull requests + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + container: + image: almalinux:9.5 + + steps: + - name: Set GHA_BRANCH_NAME + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "GHA_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV + fi + if [ "${{ github.event_name }}" = "schedule" ]; then + echo "GHA_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + fi + + - name: Set OSVERS + run: | + ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') + VERSION=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"') + echo "OSVERS=$ID-$VERSION" >> $GITHUB_ENV + + # Do this prior to checkout BioDynaMo, because the AlmaLinux docker + # container does not come with git preinstalled. This would mess + # up later calls to + # `git describe --tags` + - name: Install latest version of git + shell: bash + run: | + dnf -y --enablerepo=crb install git + + - name: Start Xvfb + run: | + set -e + dnf -y install xorg-x11-server-Xvfb + XVFBARGS=":99 -ac -screen 0 2560x1440x24" + /usr/bin/Xvfb $XVFBARGS >> /tmp/Xvfb.out 2>&1 & + disown -ar + sleep 3 + + - name: Install BioDynaMo + shell: bash + run: | + dnf update -y + dnf install -y --allowerasing sudo curl + curl https://raw.githubusercontent.com/BioDynaMo/biodynamo/${GHA_BRANCH_NAME}/util/install | bash + # remove whole BioDynaMo repository to catch errors related to paths pointing into the build dir + mktemp -d + find /tmp -iname biodynamo -type d || true + rm -rf $(find $(mktemp -d)/../* -maxdepth 1 -iname biodynamo -type d 2>/dev/null) + echo "Removed" + find /tmp -iname biodynamo -type d || true + + - name: Checkout BioDynaMo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set INSTALL_DIR + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "INSTALL_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV + fi + if [ "${{ github.event_name }}" = "schedule" ]; then + echo "INSTALL_DIR=$(echo ${HOME}/biodynamo-*)" >> $GITHUB_ENV + fi + + - name: Cache pyenv + uses: actions/cache@v4 + id: pyenv-cache + with: + path: ~/.pyenv + key: ${{ env.OSVERS }}-pyenv-3.9.1 + + - name: Install pyenv dependency + if: steps.pyenv-cache.outputs.cache-hit != 'true' + run: | + if [ ! -f "$HOME/.pyenv/bin/pyenv" ]; then + curl https://pyenv.run | bash + fi + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init --path)" + eval "$(pyenv init -)" + if [ ! -f "$HOME/.pyenv/versions/3.9.1/lib/libpython3.so" ]; then + PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.1 + fi + pyenv shell 3.9.1 + + - name: Cache Third Party Packages + uses: actions/cache@v4 + with: + path: build/third_party + key: ${{ env.OSVERS }}-third-party-${{ hashFiles('cmake/external/SHA256Digests.cmake') }} + + - name: Build BioDynaMo + shell: bash + run: | + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init --path)" + eval "$(pyenv init -)" + pyenv shell 3.9.1 + . /etc/profile.d/modules.sh || true + module load mpi + cmake \ + -Dparaview=OFF \ + -Dbenchmark=ON \ + -Dsbml=OFF \ + -Dnuma=OFF \ + -Dlibgit2=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -B build + cmake --build build --config Release + + # # Don't do this in the `Build BioDynaMo step`, because notebooks might time out in GHA + # # runners, while waiting for other targets to be compiled + # - name: Run notebooks + # shell: bash + # run: | + # export PATH="$HOME/.pyenv/bin:$PATH" + # eval "$(pyenv init --path)" + # eval "$(pyenv init -)" + # pyenv shell 3.9.1 + # . /etc/profile.d/modules.sh || true + # module load mpi + # cmake \ + # -Dnotebooks=ON \ + # -B build + # cmake --build build --config Release --target notebooks -- -j1 + + - name: Run system tests + shell: bash + working-directory: build + run: | + dnf install -y xorg-x11-server-Xvfb fontconfig mesa-dri-drivers + . $INSTALL_DIR/bin/thisbdm.sh + git config --system user.name "Test User" + git config --system user.email user@test.com + export DISPLAY=:99.0 + biodynamo new test-sim + . ../test/util.inc + run_cmake_simulation test-sim + make run-demos diff --git a/cmake/external/ROOT.cmake b/cmake/external/ROOT.cmake index 5886b471e..c3d13bb62 100644 --- a/cmake/external/ROOT.cmake +++ b/cmake/external/ROOT.cmake @@ -58,12 +58,25 @@ if(APPLE) elseif("${DETECTED_OS_VERS}" MATCHES "^osx-11") message(FATAL_ERROR "We officially only support the latest macOS 11 versions 11.6, 11.7.") endif() -#else() - #if("${DETECTED_OS_VERS}" MATCHES "^ubuntu-23" AND - #"${DETECTED_ARCH}" STREQUAL "aarch64") - #set(ROOT_SHA_KEY ubuntu-23.04-${DETECTED_ARCH}-ROOT) - #set(ROOT_TAR_FILE root_v6.30.02_cxx17_python3.9_ubuntu-23.04-${DETECTED_ARCH}.tar.gz) -# endif() +else() + if("${DETECTED_OS_VERS}" MATCHES "^ubuntu-24") + if("${DETECTED_ARCH}" STREQUAL "aarch64") + set(ROOT_SHA_KEY ubuntu-24.04-${DETECTED_ARCH}-ROOT) + set(ROOT_TAR_FILE root_v6.32.08_cxx17_python3.12_ubuntu-24.04-${DETECTED_ARCH}.tar.gz) + else() + set(ROOT_SHA_KEY ubuntu-24.04-ROOT) + set(ROOT_TAR_FILE root_v6.32.08_cxx17_python3.12_ubuntu-24.04.tar.gz) + endif() + endif() + if("${DETECTED_OS_VERS}" MATCHES "^almalinux-9") + if("${DETECTED_ARCH}" STREQUAL "aarch64") + set(ROOT_SHA_KEY almalinux-9-${DETECTED_ARCH}-ROOT) + set(ROOT_TAR_FILE root_v6.32.08_cxx17_python3.9_almalinux-9-${DETECTED_ARCH}.tar.gz) + else() + set(ROOT_SHA_KEY almalinux-9-ROOT) + set(ROOT_TAR_FILE root_v6.32.08_cxx17_python3.9_almalinux-9.tar.gz) + endif() + endif() endif() set(ROOT_SHA ${${ROOT_SHA_KEY}}) diff --git a/cmake/external/SHA256Digests.cmake b/cmake/external/SHA256Digests.cmake index b5edb87b7..06bb0e4b5 100644 --- a/cmake/external/SHA256Digests.cmake +++ b/cmake/external/SHA256Digests.cmake @@ -108,11 +108,13 @@ SET(ubuntu-22.04-ParaView afc803835973fdb8b963fe10eaf1103f2e1650e4573141964c1322 SET(ubuntu-22.04-Qt b2388d1bcca4e3741ab5b2b0fb95395aeb6c448951a0d3cdeb6db33b64a7d41c) SET(ubuntu-22.04-ROOT 24921a85b53c5cfbe9f192e523263781d595c59c9c553818349992e61efc64ac) -SET(ubuntu-23.04-aarch64-ROOT 7d2fcaaeb1e452c38c1d8436288e3171d1b6935f5b6f25d5df16b21e00ca45d8) -SET(ubuntu-23.10-aarch64-ROOT 8f6fa9db579e011ef4ae7e96830d8ab1284b6df95a1b2f46e6a1cea56fd4626f) +SET(ubuntu-24.04-ROOT xxx) +SET(ubuntu-24.04-aarch64-ROOT xxx) SET(centos-7-Libroadrunner a0b49487a28aedc4b909a71c66263d4a388964008e2b23073dd744231251470c) SET(centos-7-ParaView 45d545e75baf32c9fe30944781b4f6b172d4efd7d6cd794dcd19ec671cc5ead0) SET(centos-7-Qt 4308621ff9ec84585c3aead92a9d2de787b3c700323333b6e78ed45d04a0d2a4) SET(centos-7-ROOT 54298aa5f13dc2942925c10d755768f81f53d7135ac1a3e698e9b7ef1a3dfd1e) +SET(almalinux-9-ROOT xxx) +SET(almalinux-9-aarch64-ROOT xxx) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 2dd29ef4f..0e958b98f 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -13,10 +13,11 @@ # ----------------------------------------------------------------------------- # Detect the system flavour and version. Generate variables -# called DETECTED_OS (ubuntu-18.04, ubuntu-20.04, centos-7, osx) -# and DETECTED_OS_VERS (ubuntu-18.04, ubuntu-20.04, centos-7 or osx-11.2-i386). +# called DETECTED_OS (ubuntu-18.04, ubuntu-20.04, almalinux-9, osx) +# and DETECTED_OS_VERS (ubuntu-18.04, ubuntu-20.04, almalinux-9 or +# osx-11.2-i386). # In case the Linux arch is aarch64, the DETECTED_OS_VERS ends in -aarch64, -# like ubuntu-23.10-aarch64. For backward compatibility reasons we don't +# like ubuntu-24.04-aarch64. For backward compatibility reasons we don't # add -x86_64. function(detect_os) if(APPLE) @@ -32,12 +33,20 @@ function(detect_os) else() set(GET_OS_ID "echo $(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '\"')") set(GET_OS_VERSION "echo $(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '\"')") + set(GET_ALMA_OS_VERSION "echo $(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '\"' | cut -d . -f 1)") execute_process(COMMAND bash -c "${GET_OS_ID}" OUTPUT_VARIABLE DISTRO_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND bash -c "${GET_OS_VERSION}" - OUTPUT_VARIABLE DISTRO_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE) + if("${DISTRO_NAME}" STREQUAL "almalinux") + # strip of minor version number 9.5 -> 9 + execute_process(COMMAND bash -c "${GET_ALMA_OS_VERSION}" + OUTPUT_VARIABLE DISTRO_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + else() + execute_process(COMMAND bash -c "${GET_OS_VERSION}" + OUTPUT_VARIABLE DISTRO_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() execute_process(COMMAND arch OUTPUT_VARIABLE DISTRO_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) set(BDM_OS "${DISTRO_NAME}-${DISTRO_VERSION}") diff --git a/util/installation/almalinux-9/Dockerfile b/util/installation/almalinux-9/Dockerfile new file mode 100644 index 000000000..e11593548 --- /dev/null +++ b/util/installation/almalinux-9/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 almalinux:9.5 + +# 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 dnf update -y && dnf 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/almalinux-9/package_list_extra b/util/installation/almalinux-9/package_list_extra new file mode 100644 index 000000000..f74274559 --- /dev/null +++ b/util/installation/almalinux-9/package_list_extra @@ -0,0 +1,11 @@ +doxygen +graphviz +libxml2-devel +fontconfig-devel +freetype-devel +llvm-devel +clang-devel +clang-tools-extra +valgrind +gsl-devel +atlas-devel diff --git a/util/installation/almalinux-9/package_list_required b/util/installation/almalinux-9/package_list_required new file mode 100644 index 000000000..35555478e --- /dev/null +++ b/util/installation/almalinux-9/package_list_required @@ -0,0 +1,33 @@ +lsb_release +cmake +git +gcc +g++ +wget +man +make +ninja-build +bzip2-devel +freeglut-devel +libXext-devel +libXt-devel +libXpm-devel +libXft-devel +numactl-devel +openmpi-devel +zlib-devel +lapack-devel +blas-devel + +readline-devel +sqlite-devel +openssl-devel +xz-devel +libffi-devel +findutils +patch +which +perl-Digest-SHA +xorg-x11-server-Xvfb +fontconfig +mesa-dri-drivers diff --git a/util/installation/almalinux-9/prerequisites.sh b/util/installation/almalinux-9/prerequisites.sh new file mode 100755 index 000000000..7f84d94a2 --- /dev/null +++ b/util/installation/almalinux-9/prerequisites.sh @@ -0,0 +1,58 @@ +#!/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 dnf -y update + +# Install required packages +sudo dnf -y --enablerepo=crb install epel-release +sudo dnf -y --enablerepo=crb install \ + $(cat $BDM_PROJECT_DIR/util/installation/almalinux-9/package_list_required) + +# Install optional packages +if [ $1 == "all" ]; then + python3 -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" + # Don't install --user: the packages should end up in the PYENV_ROOT directory + python3 -m pip install $PIP_PACKAGES + # SBML integration + #sudo bash -c 'cat << EOF > /etc/yum.repos.d/springdale-7-SCL.repo +#[SCL-core] +#name=Springdale SCL Base 7.6 - x86_64 +#mirrorlist=http://springdale.princeton.edu/data/springdale/SCL/7.6/x86_64/mirrorlist +##baseurl=http://springdale.princeton.edu/data/springdale/SCL/7.6/x86_64 +#gpgcheck=1 +#gpgkey=http://springdale.math.ias.edu/data/puias/7.6/x86_64/os/RPM-GPG-KEY-puias +#EOF' + sudo dnf -y --enablerepo=crb install --nogpgcheck \ + $(cat $BDM_PROJECT_DIR/util/installation/almalinux-9/package_list_extra) +fi + +exit 0 diff --git a/util/installation/common/install.sh b/util/installation/common/install.sh index 3a64f00e9..e52c419f3 100755 --- a/util/installation/common/install.sh +++ b/util/installation/common/install.sh @@ -51,6 +51,21 @@ if [ $BDM_OS = "centos-7" ]; then module load mpi fi +if [ $BDM_OS = "almalinux-9.3" ]; then + # Turn of NUMA for Github Actions CentOS runner, because we get "mbind + # operation not permitted errors", due to docker security constraints + if [ ! -z ${GITHUB_ACTIONS+x} ]; then + BDM_CMAKE_FLAGS="$BDM_CMAKE_FLAGS -Dnuma=off" + fi + + #if [ -z ${CXX} ] && [ -z ${CC} ] ; then + # . scl_source enable devtoolset-10 + #fi + + . /etc/profile.d/modules.sh + module load mpi +fi + if [ "$BDM_OS" != "osx" ]; then export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" diff --git a/util/installation/ubuntu-24.04/Dockerfile b/util/installation/ubuntu-24.04/Dockerfile new file mode 100644 index 000000000..b13f29c3a --- /dev/null +++ b/util/installation/ubuntu-24.04/Dockerfile @@ -0,0 +1,50 @@ +# ----------------------------------------------------------------------------- +# +# 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 ubuntu:24.04 + +# man required by ROOT +RUN apt-get update && apt-get install -y \ + git \ + sudo \ + man \ + software-properties-common \ + wget \ + xvfb + +# This will avoid tzdata package from requesting user interaction (tzdata is a +# dependency of one of the prerequisites of PyEnv) +RUN if ! [ -L /etc/localtime ]; then \ + sudo ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime; \ + fi + +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 diff --git a/util/installation/ubuntu-24.04/package_list_extra b/util/installation/ubuntu-24.04/package_list_extra new file mode 100644 index 000000000..8143ab18e --- /dev/null +++ b/util/installation/ubuntu-24.04/package_list_extra @@ -0,0 +1,11 @@ +clang +clang-format +clang-tidy +doxygen +graphviz +libxml2-dev +llvm-14 +llvm-14-dev +llvm-14-runtime +valgrind +libgsl-dev diff --git a/util/installation/ubuntu-24.04/package_list_required b/util/installation/ubuntu-24.04/package_list_required new file mode 100644 index 000000000..8dc3598c1 --- /dev/null +++ b/util/installation/ubuntu-24.04/package_list_required @@ -0,0 +1,28 @@ +cmake +curl +freeglut3-dev +g++ +gcc +git +libblas-dev +libbz2-dev +liblapack-dev +libnuma-dev +libomp5 +libomp-dev +libopenmpi-dev +libpthread-stubs0-dev +make +wget +zlib1g-dev + +libbz2-dev +libffi-dev +liblzma-dev +libreadline-dev +libsqlite3-dev +libssl-dev +python3-openssl +tk-dev +xz-utils +zlib1g-dev diff --git a/util/installation/ubuntu-24.04/pip_packages.txt b/util/installation/ubuntu-24.04/pip_packages.txt new file mode 100644 index 000000000..36098f984 --- /dev/null +++ b/util/installation/ubuntu-24.04/pip_packages.txt @@ -0,0 +1,22 @@ +jupyter +jupyter-client +jupyter-console +jupyter-core +jupyter-events +jupyter-server +jupyter-server-terminals +jupyterlab +jupyterlab-pygments +jupyterlab-server +jupyterlab-widgets +metakernel +nbclassic +nbclient +nbconvert +nbformat +markupsafe +beautifulsoup4 +ipython +traitlets +websocket-client +zipp diff --git a/util/installation/ubuntu-24.04/prerequisites.sh b/util/installation/ubuntu-24.04/prerequisites.sh new file mode 100755 index 000000000..aae82dfa0 --- /dev/null +++ b/util/installation/ubuntu-24.04/prerequisites.sh @@ -0,0 +1,82 @@ +#!/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)/../../.." + +# Required to add Kitware ppa below +sudo apt-get update +sudo apt-get install apt-transport-https + +# Add ppa for newer CMake version +wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - +CODENAME=$(grep -oP '(?<=^UBUNTU_CODENAME=).+' /etc/os-release | tr -d '"') +REPO="deb https://apt.kitware.com/ubuntu/ ${CODENAME} main" +sudo apt-add-repository "$REPO" + +# Update +sudo apt-get update +sudo apt install -y cmake-data=3.22.1-1ubuntu1.22.04.1 + +# Install required packages +sudo apt-get install -y \ + $(cat $BDM_PROJECT_DIR/util/installation/ubuntu-22.04/package_list_required) + +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 + # 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-22.04/pip_packages.txt + + sudo apt-get install -y \ + $(cat $BDM_PROJECT_DIR/util/installation/ubuntu-22.04/package_list_extra) +fi + +exit 0