Skip to content

Commit

Permalink
[onnxruntime] download external scripts from upstream branch
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Sep 15, 2024
1 parent 6d4a767 commit 7572d77
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 261 deletions.
145 changes: 0 additions & 145 deletions ports/onnxruntime/abseil-cpp.cmake

This file was deleted.

109 changes: 0 additions & 109 deletions ports/onnxruntime/cuDNN.cmake

This file was deleted.

29 changes: 22 additions & 7 deletions ports/onnxruntime/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)

set(ORT_GIT_COMMIT "26250ae74d2c9a3c6860625ba4a147ddfb936907")
set(ORT_GIT_BRANCH "v${VERSION}")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO microsoft/onnxruntime
REF "v${VERSION}"
REF ${ORT_GIT_BRANCH}
SHA512 da0cd297ffc11e2f627a91e55476952b2511e36bf97fb0d9a0a8b1e2cbd12a451e1a8ead1581bfe03d08c97946f0938434edd4637cbeb28f7007533d4b37ee55
PATCHES
fix-cmake.patch
Expand All @@ -16,11 +19,20 @@ vcpkg_from_github(
fix-clang-cl-simd-compile.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/onnxruntime_external_deps.cmake" DESTINATION "${SOURCE_PATH}/cmake/external")
# todo: copied from the main branch. remove when upstream has same version
file(COPY "${CMAKE_CURRENT_LIST_DIR}/cuDNN.cmake"
"${CMAKE_CURRENT_LIST_DIR}/abseil-cpp.cmake"
DESTINATION "${SOURCE_PATH}/cmake/external"

# todo: remove when release branch contains the files
vcpkg_download_distfile(EXTERNAL_ABSEIL_CPP_CMAKE_PATH
URLS "https://raw.githubusercontent.com/microsoft/onnxruntime/main/cmake/external/abseil-cpp.cmake?full_index=1"
FILENAME onnxruntime-external-abseil.cmake
SKIP_SHA512
)
vcpkg_download_distfile(EXTERNAL_CUDNN_CMAKE_PATH
URLS "https://raw.githubusercontent.com/microsoft/onnxruntime/main/cmake/external/cuDNN.cmake?full_index=1"
FILENAME onnxruntime-external-cuDNN.cmake
SKIP_SHA512
)
file(RENAME "${EXTERNAL_ABSEIL_CPP_CMAKE_PATH}" "${SOURCE_PATH}/cmake/external/abseil-cpp.cmake")
file(RENAME "${EXTERNAL_CUDNN_CMAKE_PATH}" "${SOURCE_PATH}/cmake/external/cuDNN.cmake")

find_program(PROTOC NAMES protoc
PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf"
Expand Down Expand Up @@ -139,8 +151,8 @@ vcpkg_cmake_configure(
-Donnxruntime_USE_NEURAL_SPEED=OFF
-DUSE_NEURAL_SPEED=OFF
# for ORT_BUILD_INFO
"-DORT_GIT_COMMIT:STRING=ffceed9d44f2f3efb9dd69fa75fea51163c91d91"
"-DORT_GIT_BRANCH:STRING=v${VERSION}"
-DORT_GIT_COMMIT=${ORT_GIT_COMMIT}
-DORT_GIT_BRANCH=${ORT_GIT_BRANCH}
--compile-no-warning-as-error
OPTIONS_DEBUG
-Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF
Expand All @@ -162,6 +174,9 @@ endif()
if("directml" IN_LIST FEATURES)
vcpkg_cmake_build(TARGET onnxruntime_providers_dml LOGFILE_BASE build-directml)
endif()
if("coreml" IN_LIST FEATURES)
vcpkg_cmake_build(TARGET onnxruntime_providers_coreml LOGFILE_BASE build-coreml)
endif()
if("training" IN_LIST FEATURES)
vcpkg_cmake_build(TARGET tensorboard LOGFILE_BASE build-tensorboard)
endif()
Expand Down

0 comments on commit 7572d77

Please sign in to comment.