From 122a0c6756957187b2d414b081d5bed6416f32db Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Thu, 10 Jul 2025 14:03:53 -0700 Subject: [PATCH 01/15] update rapidjson cmake min version --- cmake/externals/rapidjson_cmake.patch | 10 ++++++++++ cmake/externals/triton.cmake | 25 +++++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 cmake/externals/rapidjson_cmake.patch diff --git a/cmake/externals/rapidjson_cmake.patch b/cmake/externals/rapidjson_cmake.patch new file mode 100644 index 000000000..2f58d8c41 --- /dev/null +++ b/cmake/externals/rapidjson_cmake.patch @@ -0,0 +1,10 @@ +diff --git a/cmake/externals/CMakeLists.txt b/cmake/externals/CMakeLists.txt +index ceda71b..67692ba 100644 +--- a/cmake/externals/CMakeLists.txt ++++ b/cmake/externals/CMakeLists.txt +@@ -1,4 +1,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.5) + if(POLICY CMP0025) + # detect Apple's Clang + cmake_policy(SET CMP0025 NEW) diff --git a/cmake/externals/triton.cmake b/cmake/externals/triton.cmake index b515b1d71..eea1c0ce6 100644 --- a/cmake/externals/triton.cmake +++ b/cmake/externals/triton.cmake @@ -86,17 +86,22 @@ else() # include path will be wrong so the build error is delayed/misleading and non-trivial to understand/resolve. set(RapidJSON_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_deps/rapidjson) set(RapidJSON_INSTALL_DIR ${RapidJSON_PREFIX}/install) + + set(rapidjson_patch_file ${PROJECT_SOURCE_DIR}/cmake/externals/rapidjson_cmake.patch) + set(rapidjson_patch_command ${triton_patch_exe} --verbose -p1 -i ${rapidjson_patch_file}) + ExternalProject_Add(RapidJSON - PREFIX ${RapidJSON_PREFIX} - URL https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.zip - URL_HASH SHA1=0fe7b4f7b83df4b3d517f4a202f3a383af7a0818 - CMAKE_ARGS -DRAPIDJSON_BUILD_DOC=OFF - -DRAPIDJSON_BUILD_EXAMPLES=OFF - -DRAPIDJSON_BUILD_TESTS=OFF - -DRAPIDJSON_HAS_STDSTRING=ON - -DRAPIDJSON_USE_MEMBERSMAP=ON - -DCMAKE_INSTALL_PREFIX=${RapidJSON_INSTALL_DIR} - ) + PREFIX ${RapidJSON_PREFIX} + URL https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.zip + URL_HASH SHA1=0fe7b4f7b83df4b3d517f4a202f3a383af7a0818 + PATCH_COMMAND ${rapidjson_patch_command} + CMAKE_ARGS -DRAPIDJSON_BUILD_DOC=OFF + -DRAPIDJSON_BUILD_EXAMPLES=OFF + -DRAPIDJSON_BUILD_TESTS=OFF + -DRAPIDJSON_HAS_STDSTRING=ON + -DRAPIDJSON_USE_MEMBERSMAP=ON + -DCMAKE_INSTALL_PREFIX=${RapidJSON_INSTALL_DIR} + ) ExternalProject_Get_Property(RapidJSON SOURCE_DIR BINARY_DIR) # message(STATUS "RapidJSON src=${SOURCE_DIR} binary=${BINARY_DIR}") From 41653adc150e1a22690396803ef6fa7471ea0d39 Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Thu, 10 Jul 2025 14:55:20 -0700 Subject: [PATCH 02/15] change patch command order --- cmake/externals/triton.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/externals/triton.cmake b/cmake/externals/triton.cmake index eea1c0ce6..03e1656af 100644 --- a/cmake/externals/triton.cmake +++ b/cmake/externals/triton.cmake @@ -86,6 +86,8 @@ else() # include path will be wrong so the build error is delayed/misleading and non-trivial to understand/resolve. set(RapidJSON_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_deps/rapidjson) set(RapidJSON_INSTALL_DIR ${RapidJSON_PREFIX}/install) + + set(triton_patch_exe patch) set(rapidjson_patch_file ${PROJECT_SOURCE_DIR}/cmake/externals/rapidjson_cmake.patch) set(rapidjson_patch_command ${triton_patch_exe} --verbose -p1 -i ${rapidjson_patch_file}) @@ -109,7 +111,6 @@ else() set(RapidJSON_ROOT_DIR ${BINARY_DIR}) set(triton_extra_cmake_args "") - set(triton_patch_exe patch) set(triton_dependencies RapidJSON) endif() #if (WIN32) From dcf91f99c326e65243c670458b403f65ee474228 Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Thu, 10 Jul 2025 15:29:19 -0700 Subject: [PATCH 03/15] update patch file --- cmake/externals/rapidjson_cmake.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/externals/rapidjson_cmake.patch b/cmake/externals/rapidjson_cmake.patch index 2f58d8c41..70815667a 100644 --- a/cmake/externals/rapidjson_cmake.patch +++ b/cmake/externals/rapidjson_cmake.patch @@ -1,7 +1,7 @@ -diff --git a/cmake/externals/CMakeLists.txt b/cmake/externals/CMakeLists.txt -index ceda71b..67692ba 100644 ---- a/cmake/externals/CMakeLists.txt -+++ b/cmake/externals/CMakeLists.txt +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ceda71b1..67692ba3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.5) From 5819f50f4dd3da20f9cc71d30e2043e1b14a466b Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Thu, 10 Jul 2025 16:02:43 -0700 Subject: [PATCH 04/15] set CURL path manually --- cmake/externals/triton.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/externals/triton.cmake b/cmake/externals/triton.cmake index 03e1656af..a007b0a77 100644 --- a/cmake/externals/triton.cmake +++ b/cmake/externals/triton.cmake @@ -110,7 +110,12 @@ else() # Set RapidJSON_ROOT_DIR for find_package. The required RapidJSONConfig.cmake file is generated in the binary dir set(RapidJSON_ROOT_DIR ${BINARY_DIR}) - set(triton_extra_cmake_args "") + # Set custom CURL paths manually because find_package(CURL) fails sometimes in CMake + set(triton_extra_cmake_args + -DCURL_INCLUDE_DIR=${CMAKE_CURRENT_BINARY_DIR}/_deps/vcpkg/installed/${vcpkg_triplet}/include + -DCURL_LIBRARY=${CMAKE_CURRENT_BINARY_DIR}/_deps/vcpkg/installed/${vcpkg_triplet}/lib/libcurl.a + ) + set(triton_dependencies RapidJSON) endif() #if (WIN32) From 5665439a9324c6c30dbd1f394da902c7d5eb9d4c Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Thu, 10 Jul 2025 18:04:39 -0700 Subject: [PATCH 05/15] print debug info in pipeline log --- cmake/externals/triton.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/externals/triton.cmake b/cmake/externals/triton.cmake index a007b0a77..103f9df92 100644 --- a/cmake/externals/triton.cmake +++ b/cmake/externals/triton.cmake @@ -157,3 +157,8 @@ add_dependencies(triton ${triton_dependencies}) ExternalProject_Get_Property(triton SOURCE_DIR BINARY_DIR) set(triton_THIRD_PARTY_DIR ${BINARY_DIR}/third-party) + +# DEBUG: Print what we think the curl include/lib dir will be +message(STATUS ">>> triton_THIRD_PARTY_DIR = ${triton_THIRD_PARTY_DIR}") +message(STATUS ">>> curl include dir = ${triton_THIRD_PARTY_DIR}/curl/build/include") +message(STATUS ">>> curl lib dir = ${triton_THIRD_PARTY_DIR}/curl/build/lib") From 6653638336e20804d741379433d773316419da2f Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Thu, 10 Jul 2025 18:27:06 -0700 Subject: [PATCH 06/15] update CURL paths --- cmake/externals/triton.cmake | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cmake/externals/triton.cmake b/cmake/externals/triton.cmake index 103f9df92..010216f68 100644 --- a/cmake/externals/triton.cmake +++ b/cmake/externals/triton.cmake @@ -110,12 +110,22 @@ else() # Set RapidJSON_ROOT_DIR for find_package. The required RapidJSONConfig.cmake file is generated in the binary dir set(RapidJSON_ROOT_DIR ${BINARY_DIR}) + set(triton_THIRD_PARTY_DIR ${BINARY_DIR}/third-party) + # Set custom CURL paths manually because find_package(CURL) fails sometimes in CMake + set(triton_curl_include_dir ${triton_THIRD_PARTY_DIR}/curl/build/include) + set(triton_curl_library ${triton_THIRD_PARTY_DIR}/curl/build/lib/libcurl.a) + set(triton_extra_cmake_args - -DCURL_INCLUDE_DIR=${CMAKE_CURRENT_BINARY_DIR}/_deps/vcpkg/installed/${vcpkg_triplet}/include - -DCURL_LIBRARY=${CMAKE_CURRENT_BINARY_DIR}/_deps/vcpkg/installed/${vcpkg_triplet}/lib/libcurl.a + -DCURL_INCLUDE_DIR=${triton_curl_include_dir} + -DCURL_LIBRARY=${triton_curl_library} ) + # Debug info + message(STATUS "Using custom CURL include dir: ${triton_curl_include_dir}") + message(STATUS "Using custom CURL library path: ${triton_curl_library}") + message(STATUS "triton_extra_cmake_args: ${triton_extra_cmake_args}") + set(triton_dependencies RapidJSON) endif() #if (WIN32) @@ -156,9 +166,3 @@ ExternalProject_Add(triton add_dependencies(triton ${triton_dependencies}) ExternalProject_Get_Property(triton SOURCE_DIR BINARY_DIR) -set(triton_THIRD_PARTY_DIR ${BINARY_DIR}/third-party) - -# DEBUG: Print what we think the curl include/lib dir will be -message(STATUS ">>> triton_THIRD_PARTY_DIR = ${triton_THIRD_PARTY_DIR}") -message(STATUS ">>> curl include dir = ${triton_THIRD_PARTY_DIR}/curl/build/include") -message(STATUS ">>> curl lib dir = ${triton_THIRD_PARTY_DIR}/curl/build/lib") From 487497bf987874fe82a844e30637c6943f8b9689 Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Fri, 11 Jul 2025 14:54:53 -0700 Subject: [PATCH 07/15] update DTRITON paths --- cmake/externals/triton.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/externals/triton.cmake b/cmake/externals/triton.cmake index 010216f68..0e1d0a0ff 100644 --- a/cmake/externals/triton.cmake +++ b/cmake/externals/triton.cmake @@ -117,8 +117,8 @@ else() set(triton_curl_library ${triton_THIRD_PARTY_DIR}/curl/build/lib/libcurl.a) set(triton_extra_cmake_args - -DCURL_INCLUDE_DIR=${triton_curl_include_dir} - -DCURL_LIBRARY=${triton_curl_library} + -DTRITON_CURL_INCLUDE_DIRS=${triton_curl_include_dir} + -DTRITON_CURL_LIBRARY=${triton_curl_library} ) # Debug info From cde57d807d60b9f44282ec8638caf7aaed05965a Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Tue, 15 Jul 2025 12:00:33 -0700 Subject: [PATCH 08/15] update Extensions CMakeLists.txt --- CMakeLists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15b550876..e45480731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -850,14 +850,31 @@ if(OCOS_ENABLE_AZURE) # curl is coming from triton but as that's an external project it isn't built yet and we have to add # paths and library names instead of cmake targets. message(STATUS "Using CURL build from triton client. Once built it should be in ${triton_THIRD_PARTY_DIR}/curl") + + # Static libcurl location (adjust if your structure differs) + set(TRITON_CURL_INCLUDE_DIR ${triton_THIRD_PARTY_DIR}/curl/build/include) + set(TRITON_CURL_LIBRARY ${triton_THIRD_PARTY_DIR}/curl/build/lib/libcurl.a) + + # Verify the file exists (optional sanity check) + if(NOT EXISTS ${TRITON_CURL_LIBRARY}) + message(FATAL_ERROR "Expected Triton libcurl at ${TRITON_CURL_LIBRARY} not found!") + endif() + + # Create an imported static library target for libcurl + add_library(libcurl STATIC IMPORTED) + set_target_properties(libcurl PROPERTIES + IMPORTED_LOCATION ${TRITON_CURL_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${TRITON_CURL_INCLUDE_DIR} + ) + target_include_directories(ocos_operators PUBLIC ${triton_THIRD_PARTY_DIR}/curl/include) # Install is to 'lib' except on CentOS (which is used for the manylinux build of the python wheel). # Side note: we have to patch the triton client CMakeLists.txt to only use 'lib64' for 64-bit builds otherwise # the build of the 32-bit python wheel fails with CURL not being found due to the invalid library # directory name. - target_link_directories(ocos_operators PUBLIC ${triton_THIRD_PARTY_DIR}/curl/lib) - target_link_directories(ocos_operators PUBLIC ${triton_THIRD_PARTY_DIR}/curl/lib64) + target_include_directories(ocos_operators PUBLIC ${TRITON_CURL_INCLUDE_DIR}) + target_link_directories(ocos_operators PUBLIC ${triton_THIRD_PARTY_DIR}/curl/build/lib) if (CMAKE_BUILD_TYPE STREQUAL "Debug") set(libcurl_target "curl-d") From c8fbacb38bc18670ed054301a9354309610d9f3f Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Tue, 15 Jul 2025 15:54:19 -0700 Subject: [PATCH 09/15] change fatal error to warning --- CMakeLists.txt | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e45480731..5d6570370 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -847,42 +847,33 @@ if(OCOS_ENABLE_AZURE) message(STATUS "Found CURL package") set(libcurl_target CURL::libcurl) else() - # curl is coming from triton but as that's an external project it isn't built yet and we have to add - # paths and library names instead of cmake targets. message(STATUS "Using CURL build from triton client. Once built it should be in ${triton_THIRD_PARTY_DIR}/curl") - + # Static libcurl location (adjust if your structure differs) set(TRITON_CURL_INCLUDE_DIR ${triton_THIRD_PARTY_DIR}/curl/build/include) set(TRITON_CURL_LIBRARY ${triton_THIRD_PARTY_DIR}/curl/build/lib/libcurl.a) - # Verify the file exists (optional sanity check) + # Sanity check if(NOT EXISTS ${TRITON_CURL_LIBRARY}) - message(FATAL_ERROR "Expected Triton libcurl at ${TRITON_CURL_LIBRARY} not found!") + message(WARNING "Triton libcurl not found yet at ${TRITON_CURL_LIBRARY}. This may be expected if Triton hasn't built yet.") endif() - # Create an imported static library target for libcurl - add_library(libcurl STATIC IMPORTED) - set_target_properties(libcurl PROPERTIES - IMPORTED_LOCATION ${TRITON_CURL_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES ${TRITON_CURL_INCLUDE_DIR} + # Define an imported target CURL::libcurl if not found + add_library(CURL::libcurl STATIC IMPORTED GLOBAL) + set_target_properties(CURL::libcurl PROPERTIES + IMPORTED_LOCATION "${TRITON_CURL_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${TRITON_CURL_INCLUDE_DIR}" ) - - target_include_directories(ocos_operators PUBLIC ${triton_THIRD_PARTY_DIR}/curl/include) - # Install is to 'lib' except on CentOS (which is used for the manylinux build of the python wheel). - # Side note: we have to patch the triton client CMakeLists.txt to only use 'lib64' for 64-bit builds otherwise - # the build of the 32-bit python wheel fails with CURL not being found due to the invalid library - # directory name. + # Link and include paths target_include_directories(ocos_operators PUBLIC ${TRITON_CURL_INCLUDE_DIR}) target_link_directories(ocos_operators PUBLIC ${triton_THIRD_PARTY_DIR}/curl/build/lib) - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(libcurl_target "curl-d") - else() - set(libcurl_target "curl") - endif() + # Use our manually created target + set(libcurl_target CURL::libcurl) endif() + # Finally, link libcurl (and others) target_link_libraries(ocos_operators PUBLIC httpclient_static ${libcurl_target} OpenSSL::Crypto OpenSSL::SSL ZLIB::ZLIB) endif() endif() From 79119f0ccfa8eebe8151f26f2c448c410f12beb1 Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Tue, 15 Jul 2025 17:58:44 -0700 Subject: [PATCH 10/15] change CURL handling --- CMakeLists.txt | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d6570370..cddc278cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -849,28 +849,20 @@ if(OCOS_ENABLE_AZURE) else() message(STATUS "Using CURL build from triton client. Once built it should be in ${triton_THIRD_PARTY_DIR}/curl") - # Static libcurl location (adjust if your structure differs) + # Paths to Triton-built curl set(TRITON_CURL_INCLUDE_DIR ${triton_THIRD_PARTY_DIR}/curl/build/include) set(TRITON_CURL_LIBRARY ${triton_THIRD_PARTY_DIR}/curl/build/lib/libcurl.a) - # Sanity check if(NOT EXISTS ${TRITON_CURL_LIBRARY}) message(WARNING "Triton libcurl not found yet at ${TRITON_CURL_LIBRARY}. This may be expected if Triton hasn't built yet.") endif() - # Define an imported target CURL::libcurl if not found - add_library(CURL::libcurl STATIC IMPORTED GLOBAL) - set_target_properties(CURL::libcurl PROPERTIES - IMPORTED_LOCATION "${TRITON_CURL_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${TRITON_CURL_INCLUDE_DIR}" - ) - - # Link and include paths + # Add include and link directories directly target_include_directories(ocos_operators PUBLIC ${TRITON_CURL_INCLUDE_DIR}) target_link_directories(ocos_operators PUBLIC ${triton_THIRD_PARTY_DIR}/curl/build/lib) - # Use our manually created target - set(libcurl_target CURL::libcurl) + # Instead of an imported target, link directly using full path + set(libcurl_target ${TRITON_CURL_LIBRARY}) endif() # Finally, link libcurl (and others) From dd64d2a2cdec3bda972ab8af5ad1fc556b9cbab7 Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Tue, 15 Jul 2025 18:55:58 -0700 Subject: [PATCH 11/15] add BUILD_BYPRODUCTS to triton.cmake --- cmake/externals/triton.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/externals/triton.cmake b/cmake/externals/triton.cmake index 0e1d0a0ff..0143b73c1 100644 --- a/cmake/externals/triton.cmake +++ b/cmake/externals/triton.cmake @@ -161,6 +161,7 @@ ExternalProject_Add(triton ${triton_extra_cmake_args} INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Skipping install step." PATCH_COMMAND ${triton_patch_command} + BUILD_BYPRODUCTS ${triton_curl_library} ) add_dependencies(triton ${triton_dependencies}) From d691a740e7c2f63f7ec1792236f584d63b468a60 Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Wed, 16 Jul 2025 15:37:13 -0700 Subject: [PATCH 12/15] update triton patch --- cmake/externals/triton_cmake.patch | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/externals/triton_cmake.patch b/cmake/externals/triton_cmake.patch index e31a03d2c..608213bdd 100644 --- a/cmake/externals/triton_cmake.patch +++ b/cmake/externals/triton_cmake.patch @@ -46,3 +46,8 @@ index bdaae25..0e599f2 100644 ) set_target_properties( +@@ -1,6 +1,9 @@ ++project(TritonClient) ++ ++# Fix missing CURL::libcurl by ensuring CURL is found ++find_package(CURL REQUIRED) From 3c2f2fc5e8898f7638fce4ad614cf26803f162c7 Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Wed, 16 Jul 2025 15:55:51 -0700 Subject: [PATCH 13/15] update triton patch again --- cmake/externals/triton_cmake.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/externals/triton_cmake.patch b/cmake/externals/triton_cmake.patch index 608213bdd..d21a5cb10 100644 --- a/cmake/externals/triton_cmake.patch +++ b/cmake/externals/triton_cmake.patch @@ -46,7 +46,7 @@ index bdaae25..0e599f2 100644 ) set_target_properties( -@@ -1,6 +1,9 @@ +@@ -468,0 +469,4 @@ +project(TritonClient) + +# Fix missing CURL::libcurl by ensuring CURL is found From a5e276342827e8ef90df5b98e26f7623e34c8fc2 Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Wed, 16 Jul 2025 17:49:36 -0700 Subject: [PATCH 14/15] update DCMAKE_PREFIX_PATH --- cmake/externals/triton_cmake.patch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/externals/triton_cmake.patch b/cmake/externals/triton_cmake.patch index d21a5cb10..d3ac3649a 100644 --- a/cmake/externals/triton_cmake.patch +++ b/cmake/externals/triton_cmake.patch @@ -15,6 +15,12 @@ index 7b11178..7749fa9 100644 set(_cc_client_depends "") if(${TRITON_ENABLE_CC_HTTP}) +@@ -149,6 +150,7 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER + -DCURL_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/${CURL_LIB_DIR}/cmake/CURL ++ -DCMAKE_PREFIX_PATH:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/${CURL_LIB_DIR}/cmake/CURL + -DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR} + -DgRPC_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/grpc/lib/cmake/grpc + -Dabsl_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/absl/lib/cmake/absl diff --git a/src/c++/library/CMakeLists.txt b/src/c++/library/CMakeLists.txt index bdaae25..0e599f2 100644 --- a/src/c++/library/CMakeLists.txt From 68918b5cf090f70c67b7089949bf2fab72e1659d Mon Sep 17 00:00:00 2001 From: Sayan Shaw Date: Thu, 17 Jul 2025 12:24:36 -0700 Subject: [PATCH 15/15] merge first 2 hunks in patch --- cmake/externals/triton_cmake.patch | 34 ++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/cmake/externals/triton_cmake.patch b/cmake/externals/triton_cmake.patch index d3ac3649a..6fafb49e0 100644 --- a/cmake/externals/triton_cmake.patch +++ b/cmake/externals/triton_cmake.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b11178..7749fa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -115,10 +115,11 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER +@@ -115,10 +115,14 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER file(STRINGS /etc/os-release DISTRO REGEX "^NAME=") string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" DISTRO "${DISTRO}") message(STATUS "Distro Name: ${DISTRO}") @@ -12,15 +12,41 @@ index 7b11178..7749fa9 100644 endif() endif() + message(STATUS "Triton client CURL_LIB_DIR=${CURL_LIB_DIR}") - ++ set(_cc_client_depends "") if(${TRITON_ENABLE_CC_HTTP}) -@@ -149,6 +150,7 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER + set(_cc_client_depends ${_cc_client_depends} curl) + endif() # TRITON_ENABLE_CC_HTTP + if(${TRITON_ENABLE_CC_GRPC} OR ${TRITON_ENABLE_PERF_ANALYZER}) + set(_cc_client_depends ${_cc_client_depends} grpc protobuf) + endif() # TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER + + if(NOT ${TRITON_ENABLE_PERF_ANALYZER} AND ${TRITON_ENABLE_PERF_ANALYZER_C_API}) + message(FATAL_ERROR "TRITON_ENABLE_PERF_ANALYZER_C_API=ON requires TRITON_ENABLE_PERF_ANALYZER=ON") + endif() # NOT TRITON_ENABLE_PERF_ANALYZER AND TRITON_ENABLE_PERF_ANALYZER_C_API + if(NOT ${TRITON_ENABLE_PERF_ANALYZER} AND ${TRITON_ENABLE_PERF_ANALYZER_TFS}) + message(FATAL_ERROR "TRITON_ENABLE_PERF_ANALYZER_TFS=ON requires TRITON_ENABLE_PERF_ANALYZER=ON") + endif() # NOT TRITON_ENABLE_PERF_ANALYZER AND TRITON_ENABLE_PERF_ANALYZER_TFS + if(NOT ${TRITON_ENABLE_PERF_ANALYZER} AND ${TRITON_ENABLE_PERF_ANALYZER_TS}) + message(FATAL_ERROR "TRITON_ENABLE_PERF_ANALYZER_TS=ON requires TRITON_ENABLE_PERF_ANALYZER=ON") + endif() # NOT TRITON_ENABLE_PERF_ANALYZER AND TRITON_ENABLE_PERF_ANALYZER_TS + + ExternalProject_Add(cc-clients + PREFIX cc-clients + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/c++" + BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/cc-clients" + CMAKE_CACHE_ARGS + ${_CMAKE_ARGS_OPENSSL_ROOT_DIR} + ${_CMAKE_ARGS_CMAKE_TOOLCHAIN_FILE} + ${_CMAKE_ARGS_VCPKG_TARGET_TRIPLET} ++ -DCMAKE_PREFIX_PATH:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/${CURL_LIB_DIR} -DCURL_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/${CURL_LIB_DIR}/cmake/CURL -+ -DCMAKE_PREFIX_PATH:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/${CURL_LIB_DIR}/cmake/CURL -DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR} -DgRPC_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/grpc/lib/cmake/grpc -Dabsl_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/absl/lib/cmake/absl + -Dc-ares_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/c-ares/lib/cmake/c-ares + -DGTEST_ROOT:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/googletest + -DTRITON_COMMON_REPO_TAG:STRING=${TRITON_COMMON_REPO_TAG} diff --git a/src/c++/library/CMakeLists.txt b/src/c++/library/CMakeLists.txt index bdaae25..0e599f2 100644 --- a/src/c++/library/CMakeLists.txt