From 8d4a8fb21079518046603e3781a88a7c1cfa6b94 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Fri, 19 Jul 2024 12:48:39 -0700 Subject: [PATCH 1/6] More general capture of linux distro --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37631ff09..41f03393f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,9 +224,12 @@ if(NOT TRITON_CORE_HEADERS_ONLY) # /etc/os-release does not exist on Windows if(EXISTS "/etc/os-release") file(STRINGS /etc/os-release DISTRO REGEX "^NAME=") + file(STRINGS /etc/os-release DISTRO_LIKE REGEX "^ID_LIKE=") string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" DISTRO "${DISTRO}") + string(REGEX REPLACE "ID_LIKE=\"(.*)\"" "\\1" DISTRO_LIKE "${DISTRO_LIKE}") message(STATUS "Distro Name: ${DISTRO}") - if(DISTRO MATCHES "CentOS.*") + message(STATUS "Distro Like: ${DISTRO_LIKE}") + if(DISTRO_LIKE MATCHES ".*rhel.*" OR DISTRO_LIKE MATCHES ".*centos.*") set (LIB_DIR "lib64") endif() endif() From 174237810b7c4ba6c26f8bcbd8034729f10ddd87 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Mon, 22 Jul 2024 15:49:36 -0700 Subject: [PATCH 2/6] rearranging libraries to link --- src/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index a4c4613ca..db15c2238 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -680,8 +680,8 @@ if(${TRITON_ENABLE_GPU}) GTest::gtest_main GTest::gmock protobuf::libprotobuf - ${CNMEM_LIBRARY} CUDA::cudart + ${CNMEM_LIBRARY} ) else() add_executable( From 733e802ca53d28ea1a97f7ce660798c11b4cefd8 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Mon, 22 Jul 2024 16:20:56 -0700 Subject: [PATCH 3/6] Adding -ldl to input_byte_size_test build --- src/test/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index db15c2238..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 From 0b1dda0f17fd5d56dc429b932118da1ce3d896e3 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Wed, 14 Aug 2024 10:15:34 -0700 Subject: [PATCH 4/6] more robust detection of rhel-like distros --- CMakeLists.txt | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41f03393f..1cf1d1921 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,19 +221,14 @@ 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=") - file(STRINGS /etc/os-release DISTRO_LIKE REGEX "^ID_LIKE=") - string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" DISTRO "${DISTRO}") - string(REGEX REPLACE "ID_LIKE=\"(.*)\"" "\\1" DISTRO_LIKE "${DISTRO_LIKE}") - message(STATUS "Distro Name: ${DISTRO}") - message(STATUS "Distro Like: ${DISTRO_LIKE}") - if(DISTRO_LIKE MATCHES ".*rhel.*" OR DISTRO_LIKE 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 # the ExternalProject dependencies (found in the third_party repo) From ca15b0f70b3bf35da297ff3afb9380caebdfb136 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Fri, 16 Aug 2024 10:30:38 -0700 Subject: [PATCH 5/6] pre-commit fix --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cf1d1921..0ceac9aea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,6 +229,7 @@ if(NOT TRITON_CORE_HEADERS_ONLY) 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 # the ExternalProject dependencies (found in the third_party repo) From cc70cfdaccf6fe4ec686d078b233a4cfd1c7b4f1 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Fri, 16 Aug 2024 10:32:14 -0700 Subject: [PATCH 6/6] pre-commit fix --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ceac9aea..3a1fc3d22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,8 +228,7 @@ if(NOT TRITON_CORE_HEADERS_ONLY) 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 # the ExternalProject dependencies (found in the third_party repo)