Skip to content

Commit

Permalink
Port to AlmaLinux 9.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
FonsRademakers committed Feb 27, 2024
1 parent a7e48d4 commit c19e603
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/external/SHA256Digests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ SET(centos-7-ParaView 45d545e75baf32c9fe30944781b4f6b172d4efd7d6cd794dcd19ec671c
SET(centos-7-Qt 4308621ff9ec84585c3aead92a9d2de787b3c700323333b6e78ed45d04a0d2a4)
SET(centos-7-ROOT 54298aa5f13dc2942925c10d755768f81f53d7135ac1a3e698e9b7ef1a3dfd1e)

SET(almalinux-9.3-aarch64-ROOT f72e4abbfcaeca16cba862310d4dada2d6a7eda16e1044bcdaea9321e50ae48a)
52 changes: 52 additions & 0 deletions util/installation/almalinux-9.3/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 almalinux:9.3

# 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 [email protected]

# 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
14 changes: 14 additions & 0 deletions util/installation/almalinux-9.3/package_list_extra
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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
atlas-devel
23 changes: 23 additions & 0 deletions util/installation/almalinux-9.3/package_list_required
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake
git
wget
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
81 changes: 81 additions & 0 deletions util/installation/almalinux-9.3/prerequisites.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/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:
<install_type> 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 update -y

# Install required packages
sudo dnf -y --enablerepo=crb install \
$(cat $BDM_PROJECT_DIR/util/installation/almalinux-9.3/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
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"
# Don't install --user: the packages should end up in the PYENV_ROOT directory
python -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.3/package_list_extra)
fi

exit 0

0 comments on commit c19e603

Please sign in to comment.