From c144043cc3e85b2863439821cb913149cec0e660 Mon Sep 17 00:00:00 2001 From: Kyle McGill <101670481+nv-kmcgill53@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:41:31 -0700 Subject: [PATCH] RHEL 8 Compatibility (#387) * More general capture of linux distro * rearranging libraries to link * Adding -ldl to input_byte_size_test build * more robust detection of rhel-like distros --- CMakeLists.txt | 14 ++++++-------- src/test/CMakeLists.txt | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37631ff09..3a1fc3d22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,15 +221,13 @@ if(NOT TRITON_CORE_HEADERS_ONLY) # Some libs are installed to ${TRITON_THIRD_PARTY_INSTALL_PREFIX}/{LIB}/lib64 instead # of ${TRITON_THIRD_PARTY_INSTALL_PREFIX}/{LIB}/lib on Centos set (LIB_DIR "lib") - # /etc/os-release does not exist on Windows - if(EXISTS "/etc/os-release") - file(STRINGS /etc/os-release DISTRO REGEX "^NAME=") - string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" DISTRO "${DISTRO}") - message(STATUS "Distro Name: ${DISTRO}") - if(DISTRO MATCHES "CentOS.*") + if(LINUX) + file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE") + if(${DISTRO_ID_LIKE} MATCHES "rhel|centos") set (LIB_DIR "lib64") - endif() - endif() + endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos") + endif(LINUX) + set(TRITON_CORE_HEADERS_ONLY OFF) # Need to use ExternalProject for our builds so that we can get the # correct dependencies between Triton shared library components and diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index a4c4613ca..2df718b30 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -672,6 +672,7 @@ if(${TRITON_ENABLE_GPU}) target_link_libraries( input_byte_size_test PRIVATE + dl triton-common-error # from repo-common triton-core triton-common-logging # from repo-common @@ -680,8 +681,8 @@ if(${TRITON_ENABLE_GPU}) GTest::gtest_main GTest::gmock protobuf::libprotobuf - ${CNMEM_LIBRARY} CUDA::cudart + ${CNMEM_LIBRARY} ) else() add_executable(