Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support 23.05 #34

Merged
merged 11 commits into from
May 13, 2023
41 changes: 13 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cmake_minimum_required(VERSION 3.17)
project(tritonthirdparty LANGUAGES C CXX)

#
# ExternalProject Dependencies
#
Expand All @@ -38,39 +36,41 @@ project(tritonthirdparty LANGUAGES C CXX)
# allows a good point to perform the source install.
#
include(ExternalProject)

if(NOT TRITON_THIRD_PARTY_INSTALL_PREFIX)
message(FATAL_ERROR "TRITON_THIRD_PARTY_INSTALL_PREFIX must be set")
endif() # TRITON_THIRD_PARTY_INSTALL_PREFIX

if(NOT TRITON_THIRD_PARTY_SRC_INSTALL_PREFIX)
message(STATUS "TRITON_THIRD_PARTY_SRC_INSTALL_PREFIX not set")
set(INSTALL_SRC_DEST_ARG "")
else()
set(INSTALL_SRC_DEST_ARG --dest ${TRITON_THIRD_PARTY_SRC_INSTALL_PREFIX})
endif() # TRITON_THIRD_PARTY_INSTALL_PREFIX

# If CMAKE_TOOLCHAIN_FILE is set, propagate that hint path to the external
# projects.
set(_CMAKE_ARGS_CMAKE_TOOLCHAIN_FILE "")
if (CMAKE_TOOLCHAIN_FILE)
set(_CMAKE_ARGS_CMAKE_TOOLCHAIN_FILE "-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}")
endif()

# If VCPKG_TARGET_TRIPLET is set, propagate that hint path to the external
# projects.
set(_CMAKE_ARGS_VCPKG_TARGET_TRIPLET "")
if (VCPKG_TARGET_TRIPLET)
set(_CMAKE_ARGS_VCPKG_TARGET_TRIPLET "-DVCPKG_TARGET_TRIPLET:STRING=${VCPKG_TARGET_TRIPLET}")
endif()

# If OPENSSL_ROOT_DIR is set, propagate that hint path to the external
# projects with OpenSSL dependency.
set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "")
if (OPENSSL_ROOT_DIR)
set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}")
endif()

# [FIXME] apply the same version to all third party, and pick a Triton default
if (NOT DEFINED CMAKE_CXX_STANDARD)
set(THIRD_PARTY_CMAKE_CXX_STANDARD 17)
else()
set(THIRD_PARTY_CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD})
endif()

#
# Build libcurl
#
Expand Down Expand Up @@ -98,7 +98,6 @@ ExternalProject_Add(curl
${LIBCURL_EXTRA_BUILD_ARGS}
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
)

ExternalProject_Add(grpc-repo
PREFIX grpc-repo
GIT_REPOSITORY "https://github.com/grpc/grpc.git"
Expand All @@ -111,14 +110,13 @@ ExternalProject_Add(grpc-repo
TEST_COMMAND ""
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG} --dest-basename=grpc_1.48.0
)

#
# Build nlohmann/json
#
ExternalProject_Add(nlohmann-json
PREFIX nlohmann-json
GIT_REPOSITORY "https://github.com/nlohmann/json.git"
GIT_TAG "v3.9.0"
GIT_TAG "v3.10.5"
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/json"
EXCLUDE_FROM_ALL ON
CMAKE_CACHE_ARGS
Expand All @@ -130,7 +128,6 @@ ExternalProject_Add(nlohmann-json
-H. -Bcmake-out
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG} --dest-basename=nlohmann-json
)

#
# Build protobuf project from grpc-repo, but apply a patch that is available
# in 3.20.0, to resolve a linking issue on Windows
Expand Down Expand Up @@ -163,7 +160,6 @@ ExternalProject_Add(protobuf
PATCH_COMMAND git cherry-pick -n f180289c4670ca1afde5865bb8a7f2b61a3efcc5
DEPENDS grpc-repo
)

#
# Build absl (abseil) project from grpc-repo
#
Expand All @@ -176,13 +172,13 @@ ExternalProject_Add(absl
EXCLUDE_FROM_ALL ON
DOWNLOAD_COMMAND ""
CMAKE_CACHE_ARGS
-DCMAKE_CXX_STANDARD:STRING=${THIRD_PARTY_CMAKE_CXX_STANDARD}
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/absl
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=OFF
DEPENDS grpc-repo
)

#
# Build googletest project from grpc-repo
#
Expand All @@ -201,15 +197,13 @@ ExternalProject_Add(googletest
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/googletest
DEPENDS grpc-repo
)

# Location where protobuf-config.cmake will be installed varies by
# platform
if (WIN32)
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${TRITON_THIRD_PARTY_INSTALL_PREFIX}/protobuf/cmake")
else()
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${TRITON_THIRD_PARTY_INSTALL_PREFIX}/protobuf/lib/cmake/protobuf")
endif()

#
# Build c-ares project from grpc-repo
#
Expand All @@ -231,7 +225,6 @@ ExternalProject_Add(c-ares
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/c-ares
DEPENDS grpc-repo
)

#
# Build GRPC
#
Expand All @@ -244,6 +237,7 @@ ExternalProject_Add(grpc
EXCLUDE_FROM_ALL ON
DOWNLOAD_COMMAND ""
CMAKE_CACHE_ARGS
-DCMAKE_CXX_STANDARD:STRING=${THIRD_PARTY_CMAKE_CXX_STANDARD}
-DgRPC_INSTALL:BOOL=ON
-DgRPC_BUILD_TESTS:BOOL=OFF
-DgRPC_PROTOBUF_PROVIDER:STRING=package
Expand All @@ -260,7 +254,6 @@ ExternalProject_Add(grpc
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/grpc
DEPENDS grpc-repo c-ares protobuf absl
)

#
# Build libevent
#
Expand All @@ -278,7 +271,6 @@ ExternalProject_Add(libevent
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/libevent
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
)

#
# Build patched libevhtp
#
Expand Down Expand Up @@ -325,7 +317,6 @@ ExternalProject_Add(libevhtp
DEPENDS libevent
)
endif()

#
# Build Prometheus C++ library
#
Expand All @@ -351,7 +342,6 @@ ExternalProject_Add(prometheus-cpp
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/prometheus-cpp
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
)

#
# Build crc32c
#
Expand All @@ -376,7 +366,6 @@ ExternalProject_Add(crc32c
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/crc32c
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
)

# This is necessary because google-cloud-cpp
# does not pass protobuf_DIR and gRPC_DIR etc to its
# external projects but expects them in CMAKE_PREFIX_PATH.
Expand All @@ -390,7 +379,6 @@ set(GCS_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}
${TRITON_THIRD_PARTY_INSTALL_PREFIX}/grpc/lib/cmake/grpc
${TRITON_THIRD_PARTY_INSTALL_PREFIX}/nlohmann_json/lib/cmake/nlohmann_json
${_FINDPACKAGE_PROTOBUF_CONFIG_DIR})

#
# Build google-cloud-cpp
#
Expand All @@ -414,7 +402,6 @@ ExternalProject_Add(google-cloud-cpp
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
DEPENDS grpc c-ares protobuf crc32c absl nlohmann-json
)

#
# Build azure-storage-cpplite
#
Expand All @@ -433,10 +420,9 @@ ExternalProject_Add(azure-storage-cpplite
-DCURL_INCLUDE_DIR:STRING=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/include
-DCURL_LIBRARY:STRING=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/lib
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/azure-storage-cpplite
PATCH_COMMAND git cherry-pick --no-commit a3a9c21de3fa9932dcfceb2b6617757a511c75c3 && python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
PATCH_COMMAND git cherry-pick --no-commit a3a9c21de3fa9932dcfceb2b6617757a511c75c3 && git apply ${CMAKE_CURRENT_SOURCE_DIR}/tools/azure_no_deprecated.patch && python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
DEPENDS curl
)

#
# Build CNMeM (CUDA memory management library)
#
Expand All @@ -452,14 +438,13 @@ ExternalProject_Add(cnmem
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/cnmem
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
)

#
# Build aws-sdk-cpp
#
ExternalProject_Add(aws-sdk-cpp
PREFIX aws-sdk-cpp
GIT_REPOSITORY "https://github.com/aws/aws-sdk-cpp.git"
GIT_TAG "1.8.186"
GIT_TAG "1.11.60"
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/aws-sdk-cpp/src/aws-sdk-cpp"
EXCLUDE_FROM_ALL ON
CMAKE_CACHE_ARGS
Expand All @@ -473,7 +458,6 @@ ExternalProject_Add(aws-sdk-cpp
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/aws-sdk-cpp
PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG}
)

#
# Build OpenTelemetry C++ library
# [FIXME] Remove `NOT WIN32` condition when Windows build works on Triton (JIRA DLIS-4786)
Expand All @@ -491,6 +475,7 @@ if (NOT WIN32)
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/opentelemetry-cpp/src/opentelemetry-cpp"
EXCLUDE_FROM_ALL ON
CMAKE_CACHE_ARGS
-DCMAKE_CXX_STANDARD:STRING=${THIRD_PARTY_CMAKE_CXX_STANDARD}
-DProtobuf_LIBRARIES:STRING=${PROTO_LIB_PATH}
-DProtobuf_INCLUDE_DIR:STRING=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/protobuf/include
-DProtobuf_PROTOC_EXECUTABLE:STRING=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/protobuf/bin/protoc
Expand Down
13 changes: 13 additions & 0 deletions tools/azure_no_deprecated.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dfb441e..af3dd36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
nv-kmcgill53 marked this conversation as resolved.
Show resolved Hide resolved
@@ -173,7 +173,7 @@ target_link_libraries(azure-storage-lite Threads::Threads ${CURL_LIBRARIES} ${EX
if(MSVC)
target_compile_options(azure-storage-lite PRIVATE /W4 /WX /MP)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- target_compile_options(azure-storage-lite PRIVATE -Wall -Wextra -Werror -pedantic)
+ target_compile_options(azure-storage-lite PRIVATE -Wall -Wextra -Werror -pedantic -Wno-deprecated-declarations)
endif()

if(BUILD_ADLS)