Skip to content

Commit

Permalink
RHEL 8 Compatibility (#387)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nv-kmcgill53 authored Aug 16, 2024
1 parent 9ed1544 commit 1a36c43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -680,8 +681,8 @@ if(${TRITON_ENABLE_GPU})
GTest::gtest_main
GTest::gmock
protobuf::libprotobuf
${CNMEM_LIBRARY}
CUDA::cudart
${CNMEM_LIBRARY}
)
else()
add_executable(
Expand Down

0 comments on commit 1a36c43

Please sign in to comment.