Skip to content

Commit 65fd7f9

Browse files
author
Sayan Shaw
committed
fix GCC 14 compatibility issues
1 parent e2f6e3e commit 65fd7f9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

cmake/externals/triton.cmake

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,24 @@ if (WIN32)
7777
set(triton_patch_exe ${PROJECT_SOURCE_DIR}/cmake/externals/git.Win32.2.41.03.patch/patch.exe)
7878
set(triton_dependencies ${VCPKG_DEPENDENCIES})
7979
else()
80-
# RapidJSON 1.1.0 (released in 2016) is compatible with the triton build. Later code is not compatible without
81-
# patching due to the change in variable name for the include dir from RAPIDJSON_INCLUDE_DIRS to
82-
# RapidJSON_INCLUDE_DIRS in the generated cmake file used by find_package:
83-
# https://github.com/Tencent/rapidjson/commit/b91c515afea9f0ba6a81fc670889549d77c83db3
84-
# The triton code here https://github.com/triton-inference-server/common/blob/main/CMakeLists.txt is using
85-
# RAPIDJSON_INCLUDE_DIRS so the build fails if a newer RapidJSON version is used. It will find the package but the
86-
# include path will be wrong so the build error is delayed/misleading and non-trivial to understand/resolve.
80+
# RapidJSON 1.1.0 (released in 2016) has C++ compatibility issues with GCC 14 (deprecated std::iterator,
81+
# const member assignment). Use a more recent commit that includes these fixes.
8782
#
88-
# Patch RapidJSON to update cmake_minimum_required from 2.8 to 3.5 to fix build with newer CMake versions.
83+
# Note: Commit f54b0e47a08782a6131cc3d60f94d038fa6e0a51 is the last commit that uses RAPIDJSON_INCLUDE_DIRS
84+
# in RapidJSONConfig.cmake.in. Later commits changed this to RapidJSON_INCLUDE_DIRS which would break the
85+
# triton build (see https://github.com/Tencent/rapidjson/commit/b91c515afea9f0ba6a81fc670889549d77c83db3).
86+
# The triton code expects RAPIDJSON_INCLUDE_DIRS: https://github.com/triton-inference-server/common/blob/main/CMakeLists.txt
87+
#
88+
# We also patch cmake_minimum_required to 3.5 to fix build with newer CMake versions (CMake 4.x removed
89+
# support for cmake_minimum_required < 3.5).
8990
set(RapidJSON_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_deps/rapidjson)
9091
set(RapidJSON_INSTALL_DIR ${RapidJSON_PREFIX}/install)
9192
set(rapidjson_patch_command patch --verbose -p1 -i ${PROJECT_SOURCE_DIR}/cmake/externals/rapidjson_cmake.patch)
9293
ExternalProject_Add(RapidJSON
9394
PREFIX ${RapidJSON_PREFIX}
94-
URL https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.zip
95-
URL_HASH SHA1=0fe7b4f7b83df4b3d517f4a202f3a383af7a0818
95+
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
96+
GIT_TAG f54b0e47a08782a6131cc3d60f94d038fa6e0a51
97+
GIT_SHALLOW TRUE
9698
PATCH_COMMAND ${rapidjson_patch_command}
9799
CMAKE_ARGS -DRAPIDJSON_BUILD_DOC=OFF
98100
-DRAPIDJSON_BUILD_EXAMPLES=OFF

0 commit comments

Comments
 (0)