Skip to content

Commit 1a36c43

Browse files
authored
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
1 parent 9ed1544 commit 1a36c43

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,13 @@ if(NOT TRITON_CORE_HEADERS_ONLY)
221221
# Some libs are installed to ${TRITON_THIRD_PARTY_INSTALL_PREFIX}/{LIB}/lib64 instead
222222
# of ${TRITON_THIRD_PARTY_INSTALL_PREFIX}/{LIB}/lib on Centos
223223
set (LIB_DIR "lib")
224-
# /etc/os-release does not exist on Windows
225-
if(EXISTS "/etc/os-release")
226-
file(STRINGS /etc/os-release DISTRO REGEX "^NAME=")
227-
string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" DISTRO "${DISTRO}")
228-
message(STATUS "Distro Name: ${DISTRO}")
229-
if(DISTRO MATCHES "CentOS.*")
224+
if(LINUX)
225+
file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE")
226+
if(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
230227
set (LIB_DIR "lib64")
231-
endif()
232-
endif()
228+
endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
229+
endif(LINUX)
230+
set(TRITON_CORE_HEADERS_ONLY OFF)
233231

234232
# Need to use ExternalProject for our builds so that we can get the
235233
# correct dependencies between Triton shared library components and

src/test/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ if(${TRITON_ENABLE_GPU})
672672
target_link_libraries(
673673
input_byte_size_test
674674
PRIVATE
675+
dl
675676
triton-common-error # from repo-common
676677
triton-core
677678
triton-common-logging # from repo-common
@@ -680,8 +681,8 @@ if(${TRITON_ENABLE_GPU})
680681
GTest::gtest_main
681682
GTest::gmock
682683
protobuf::libprotobuf
683-
${CNMEM_LIBRARY}
684684
CUDA::cudart
685+
${CNMEM_LIBRARY}
685686
)
686687
else()
687688
add_executable(

0 commit comments

Comments
 (0)