From f4d25ae3150f6589deab18fe76593bb2499b05fe Mon Sep 17 00:00:00 2001 From: luncliff Date: Thu, 27 Jun 2024 22:32:32 +0900 Subject: [PATCH] [onnxruntime] source patch for DISABLE_ABSEIL --- .circleci/port-linux.txt | 1 + ports/onnxruntime/fix-sources.patch | 26 ++++++++++++++++++++++++++ ports/onnxruntime/portfile.cmake | 1 + 3 files changed, 28 insertions(+) create mode 100644 ports/onnxruntime/fix-sources.patch diff --git a/.circleci/port-linux.txt b/.circleci/port-linux.txt index fa0cf4f5..598bee82 100644 --- a/.circleci/port-linux.txt +++ b/.circleci/port-linux.txt @@ -3,3 +3,4 @@ grpc[codegen] flatbuffers abseil liblzma +onnxruntime diff --git a/ports/onnxruntime/fix-sources.patch b/ports/onnxruntime/fix-sources.patch new file mode 100644 index 00000000..702d467c --- /dev/null +++ b/ports/onnxruntime/fix-sources.patch @@ -0,0 +1,26 @@ +diff --git a/onnxruntime/core/framework/kernel_type_str_resolver.cc b/onnxruntime/core/framework/kernel_type_str_resolver.cc +index d05e02e..6f8a47c 100644 +--- a/onnxruntime/core/framework/kernel_type_str_resolver.cc ++++ b/onnxruntime/core/framework/kernel_type_str_resolver.cc +@@ -50,7 +50,7 @@ Status KernelTypeStrResolver::ResolveKernelTypeStr(const Node& node, std::string + // TODO(edgchen1) maybe we can use transparent hash/eq to enable lookup with string_view + const auto type_str_it = type_str_map.find(std::string(kernel_type_str)); + #else +- const auto type_str_it = type_str_map.find(kernel_type_str); ++ const auto type_str_it = type_str_map.find(std::string(kernel_type_str)); // abseil::raw_hash_set fails deduction ... + #endif + + ORT_RETURN_IF(type_str_it == type_str_map.end(), +diff --git a/onnxruntime/core/framework/ort_value_name_idx_map.h b/onnxruntime/core/framework/ort_value_name_idx_map.h +index 1b5f6bc..b721205 100644 +--- a/onnxruntime/core/framework/ort_value_name_idx_map.h ++++ b/onnxruntime/core/framework/ort_value_name_idx_map.h +@@ -36,7 +36,7 @@ class OrtValueNameIdxMap { + #ifdef DISABLE_ABSEIL + auto it = map_.find(std::string(name)); + #else +- auto it = map_.find(name); ++ auto it = map_.find(std::string(name)); // abseil::raw_hash_set fails deduction ... + #endif + if (it == map_.end()) { + return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "Could not find OrtValue with name '", name, "'"); diff --git a/ports/onnxruntime/portfile.cmake b/ports/onnxruntime/portfile.cmake index cc7566fa..457cbc7a 100644 --- a/ports/onnxruntime/portfile.cmake +++ b/ports/onnxruntime/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( SHA512 2e1d724eda5635fc24f93966412c197c82ee933aaea4f4ce907b5f2ee7730c1e741f2ef4d50a2d54284fc7bd05bf104bd3c56fd4466525fcd70e63c07fbb2b16 PATCHES fix-cmake.patch + fix-sources.patch # fix-clang-cl-simd-compile.patch fix-llvm-rc-unicode.patch )