Skip to content

Commit

Permalink
Update dependency installation, build and packaging scripts for AlmaL…
Browse files Browse the repository at this point in the history
…inux9 (Xilinx#7861)

* Update the dependency installation script to work on almalinux9

Signed-off-by: Quentin Berthet <[email protected]>

* Allow to build and package on AlmaLinux9

Signed-off-by: Quentin Berthet <[email protected]>

---------

Signed-off-by: Quentin Berthet <[email protected]>
Co-authored-by: Quentin Berthet <[email protected]>
  • Loading branch information
qberthet and Quentin Berthet authored Dec 21, 2023
1 parent 065eb63 commit 2a50537
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CMAKE_MAJOR_VERSION=`cmake --version | head -n 1 | awk '{print $3}' |awk -F. '{p
CPU=`uname -m`

if [[ $CMAKE_MAJOR_VERSION != 3 ]]; then
if [[ $OSDIST == "centos" ]] || [[ $OSDIST == "amzn" ]] || [[ $OSDIST == "rhel" ]] || [[ $OSDIST == "fedora" ]] || [[ $OSDIST == "mariner" ]]; then
if [[ $OSDIST == "centos" ]] || [[ $OSDIST == "amzn" ]] || [[ $OSDIST == "rhel" ]] || [[ $OSDIST == "fedora" ]] || [[ $OSDIST == "mariner" ]] || [[ $OSDIST == "almalinux" ]]; then
CMAKE=cmake3
if [[ ! -x "$(command -v $CMAKE)" ]]; then
echo "$CMAKE is not installed, please run xrtdeps.sh"
Expand Down
2 changes: 1 addition & 1 deletion src/CMake/cpackLin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ if (${LINUX_FLAVOR} MATCHES "^(ubuntu|debian)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_XRT_PACKAGE_DEPENDS})
endif()

elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles|mariner)")
elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles|mariner|almalinux)")
execute_process(
COMMAND uname -m
OUTPUT_VARIABLE CPACK_ARCH
Expand Down
2 changes: 1 addition & 1 deletion src/CMake/pkgconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ message("-- Preparing XRT pkg-config")

if (${LINUX_FLAVOR} MATCHES "^(ubuntu)")
set(XRT_PKG_CONFIG_DIR "/usr/lib/pkgconfig")
elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles)")
elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles|almalinux)")
set(XRT_PKG_CONFIG_DIR "/usr/lib64/pkgconfig")
else ()
set(XRT_PKG_CONFIG_DIR "/usr/share/pkgconfig")
Expand Down
2 changes: 1 addition & 1 deletion src/python/pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif(CMAKE_VERSION VERSION_LESS "3.12")
if (HAS_PYTHON)
if (${LINUX_FLAVOR} MATCHES "^(ubuntu|debian)")
SET(PKGDIR "dist-packages")
elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles)")
elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles|almalinux)")
SET(PKGDIR "site-packages")
endif(${LINUX_FLAVOR} MATCHES "^(ubuntu|debian)")

Expand Down
25 changes: 22 additions & 3 deletions src/runtime_src/tools/scripts/xrtdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ update_package_list()
{
if [ $FLAVOR == "ubuntu" ] || [ $FLAVOR == "debian" ]; then
ub_package_list
elif [ $FLAVOR == "centos" ] || [ $FLAVOR == "rhel" ] || [ $FLAVOR == "amzn" ]; then
elif [ $FLAVOR == "centos" ] || [ $FLAVOR == "rhel" ] || [ $FLAVOR == "amzn" ] || [ $FLAVOR == "almalinux" ]; then
rh_package_list
elif [ $FLAVOR == "fedora" ]; then
fd_package_list
Expand All @@ -446,7 +446,7 @@ validate()
fi
fi

if [ $FLAVOR == "centos" ] || [ $FLAVOR == "rhel" ] || [ $FLAVOR == "amzn" ]; then
if [ $FLAVOR == "centos" ] || [ $FLAVOR == "rhel" ] || [ $FLAVOR == "amzn" ] || [ $FLAVOR == "almalinux" ]; then
rpm -q "${RH_LIST[@]}"
if [ $? == 0 ] ; then
# Validate we have OpenCL 2.X headers installed
Expand Down Expand Up @@ -624,6 +624,23 @@ prep_sles()
fi
}

prep_alma9()
{
echo "Enabling EPEL repository..."
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
yum check-update

echo "Enabling CodeReady-Builder repository..."
dnf config-manager --set-enabled crb
}

prep_alma()
{
if [ $MAJOR -ge 9 ]; then
prep_alma9
fi
}

install()
{
if [ $FLAVOR == "ubuntu" ] || [ $FLAVOR == "debian" ]; then
Expand All @@ -648,9 +665,11 @@ install()
prep_mariner
elif [ $FLAVOR == "sles" ]; then
prep_sles
elif [ $FLAVOR == "almalinux" ]; then
prep_alma
fi

if [ $FLAVOR == "rhel" ] || [ $FLAVOR == "centos" ] || [ $FLAVOR == "amzn" ]; then
if [ $FLAVOR == "rhel" ] || [ $FLAVOR == "centos" ] || [ $FLAVOR == "amzn" ] || [ $FLAVOR == "almalinux" ]; then
echo "Installing RHEL/CentOS packages..."
yum install -y "${RH_LIST[@]}"
if [ $ds9 == 1 ]; then
Expand Down

0 comments on commit 2a50537

Please sign in to comment.