From 5dcd49f72631f43a8fc3d799ef65f33eb6b34c08 Mon Sep 17 00:00:00 2001 From: Jeffrey Poznanovic Date: Mon, 2 Mar 2020 20:15:01 +0000 Subject: [PATCH] Added CentOS-6 mods to support manylinux2010 Change-Id: I8c303ccfdc7d314d1b4609ed6181d46795ada621 --- CMakeLists.txt | 9 +++++++++ RPM/libhsakmt.spec | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a3e969764..cc186fd7d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,13 @@ if( EXISTS "/etc/os-release" ) string( REPLACE "ID=" "" DISTRO_ID "${DISTRO_ID}" ) string( REPLACE "VERSION_ID=" "" DISTRO_RELEASE "${DISTRO_RELEASE}" ) message( STATUS "Detected distribution: ${DISTRO_ID}:${DISTRO_RELEASE}" ) +elseif( EXISTS "/etc/centos-release" ) + # Example: CentOS release 6.10 (Final) + file( STRINGS "/etc/centos-release" DISTRO_FULL_STR REGEX "release" ) + string( REGEX MATCH "^[a-zA-Z]+" DISTRO_ID "${DISTRO_FULL_STR}" ) + string( TOLOWER "${DISTRO_ID}" DISTRO_ID ) + string( REGEX MATCH "[0-9]+" DISTRO_RELEASE "${DISTRO_FULL_STR}" ) + message( STATUS "Detected distribution: ${DISTRO_ID}:${DISTRO_RELEASE}" ) else() message( STATUS "Not able to detect OS" ) endif() @@ -193,6 +200,8 @@ set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libnuma1, libpci3, zlib1g, libudev1" # RPM package specific variables if( DISTRO_ID MATCHES "sles" ) set ( CPACK_RPM_PACKAGE_REQUIRES "glibc, libnuma-devel, pciutils, libgcc_s1") +elseif( DISTRO_ID MATCHES "centos" AND DISTRO_RELEASE MATCHES "6" ) + set ( CPACK_RPM_PACKAGE_REQUIRES "glibc, numactl, pciutils-libs, libgcc" ) else() set ( CPACK_RPM_PACKAGE_REQUIRES "glibc, numactl-libs, pciutils-libs, libgcc" ) endif() diff --git a/RPM/libhsakmt.spec b/RPM/libhsakmt.spec index 631d65ba40..c219ef7581 100644 --- a/RPM/libhsakmt.spec +++ b/RPM/libhsakmt.spec @@ -9,7 +9,12 @@ Summary: Thunk libraries for AMD KFD Group: System Environment/Libraries License: Advanced Micro Devices Inc. + +%if 0%{?centos} == 6 +Requires: numactl +%else Requires: numactl-libs +%endif %description