summarylogtreecommitdiffstats
path: root/build-fixes.patch
blob: f228eb8aec6eb9f4d49a7fb1c2fefea465605072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 3cee60f3..3328fc06 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -314,7 +314,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/external)
 
 if(onnxruntime_PREFER_SYSTEM_LIB)
   set(protobuf_MODULE_COMPATIBLE ON)
-  find_package(protobuf)
+  find_package(Protobuf)
 endif()
 
 
@@ -327,7 +327,7 @@ if(Protobuf_FOUND OR Protobuf_FOUND)
     if(NOT Protobuf_USE_STATIC_LIBS)
       #Indeed here should be a warning, not a fatal error. ONNX Runtime itself can work in such a 
       #setting but it may cause compatibility issue when ONNX Runtime is integrated with the other ONNX ecosystem softwares.
-      message(FATAL_ERROR "Please enable Protobuf_USE_STATIC_LIBS")
+      message(WARNING "Please enable Protobuf_USE_STATIC_LIBS")
     endif()
   else()
     set(PROTOBUF_LIB protobuf::libprotobuf-lite)
@@ -395,7 +395,7 @@ get_filename_component(REPO_ROOT "${REPO_ROOT}" ABSOLUTE)
 set(ONNXRUNTIME_INCLUDE_DIR ${REPO_ROOT}/include/onnxruntime)
 
 
-add_subdirectory(external/date EXCLUDE_FROM_ALL)
+find_package(date REQUIRED)
 
 if(onnxruntime_PREFER_SYSTEM_LIB)
   find_package(re2)  
diff --git a/cmake/external/Findre2.cmake b/cmake/external/Findre2.cmake
new file mode 100644
index 00000000..4c91696c
--- /dev/null
+++ b/cmake/external/Findre2.cmake
@@ -0,0 +1,3 @@
+find_package(PkgConfig)
+pkg_check_modules(re2 REQUIRED IMPORTED_TARGET GLOBAL re2)
+add_library(re2::re2 ALIAS PkgConfig::re2)
diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake
index d33e9e14..5770e818 100644
--- a/cmake/onnxruntime_common.cmake
+++ b/cmake/onnxruntime_common.cmake
@@ -86,7 +86,7 @@ if (onnxruntime_USE_MIMALLOC_STL_ALLOCATOR OR onnxruntime_USE_MIMALLOC_ARENA_ALL
     endif()
 endif()
 
-onnxruntime_add_include_to_target(onnxruntime_common date_interface safeint_interface)
+onnxruntime_add_include_to_target(onnxruntime_common date::date safeint_interface)
 target_include_directories(onnxruntime_common PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT}
         PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/external/nsync/public")
 
diff --git a/cmake/onnxruntime_python.cmake b/cmake/onnxruntime_python.cmake
index 7dce1309..7102975b 100644
--- a/cmake/onnxruntime_python.cmake
+++ b/cmake/onnxruntime_python.cmake
@@ -1,7 +1,6 @@
 # Copyright (c) Microsoft Corporation. All rights reserved.
 # Licensed under the MIT License.
 
-include(pybind11)
 FIND_PACKAGE(NumPy)
 
 if(NOT PYTHON_INCLUDE_DIR)
@@ -99,7 +98,6 @@ endif()
 
 set(onnxruntime_pybind11_state_dependencies
     ${onnxruntime_EXTERNAL_DEPENDENCIES}
-    ${pybind11_dep}
 )
 set_property(TARGET onnxruntime_pybind11_state APPEND_STRING PROPERTY LINK_FLAGS ${ONNXRUNTIME_SO_LINK_FLAG} ${onnxruntime_DELAYLOAD_FLAGS})
 add_dependencies(onnxruntime_pybind11_state ${onnxruntime_pybind11_state_dependencies})
diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake
index d1bd347c..0c4b81e4 100644
--- a/cmake/onnxruntime_unittests.cmake
+++ b/cmake/onnxruntime_unittests.cmake
@@ -40,7 +40,7 @@ function(AddTest)
   else()
     target_link_libraries(${_UT_TARGET} PRIVATE ${_UT_LIBS} GTest::gtest GTest::gmock ${onnxruntime_EXTERNAL_LIBRARIES})
   endif()
-  onnxruntime_add_include_to_target(${_UT_TARGET} date_interface safeint_interface)
+  onnxruntime_add_include_to_target(${_UT_TARGET} date::date safeint_interface)
   target_include_directories(${_UT_TARGET} PRIVATE ${TEST_INC_DIR})
   if (onnxruntime_USE_CUDA)
     target_include_directories(${_UT_TARGET} PRIVATE ${CUDA_INCLUDE_DIRS} ${onnxruntime_CUDNN_HOME}/include)
diff --git a/onnxruntime/core/session/inference_session_utils.h b/onnxruntime/core/session/inference_session_utils.h
index 57159083..9fa7dce0 100644
--- a/onnxruntime/core/session/inference_session_utils.h
+++ b/onnxruntime/core/session/inference_session_utils.h
@@ -6,7 +6,7 @@
 #include "core/session/inference_session.h"
 #include "core/framework/session_options.h"
 #include "core/common/common.h"
-#include "single_include/nlohmann/json.hpp"
+#include <nlohmann/json.hpp>
 
 using json = nlohmann::json;
 
diff --git a/onnxruntime/test/providers/cpu/ml/linearregressor_test.cc b/onnxruntime/test/providers/cpu/ml/linearregressor_test.cc
index c6eb3f5f..2b6dff61 100644
--- a/onnxruntime/test/providers/cpu/ml/linearregressor_test.cc
+++ b/onnxruntime/test/providers/cpu/ml/linearregressor_test.cc
@@ -73,7 +73,7 @@ TEST_P(LinearRegressorTest, LinearRegressorUniTarget) {
 }
 
 // For PROBIT, all the output values are NaN.
-INSTANTIATE_TEST_SUITE_P(
+INSTANTIATE_TEST_CASE_P(
     LinearRegressorTest, LinearRegressorTest,
     testing::Values(LinearRegressorParam("NONE", {32.0f, 14.0f, -166.0f}, 1),
                     LinearRegressorParam("SOFTMAX", {32.0f, 14.0f, -166.0f}, 1),
diff --git a/onnxruntime/test/shared_lib/test_inference.cc b/onnxruntime/test/shared_lib/test_inference.cc
index 4b5b6731..08726f8b 100644
--- a/onnxruntime/test/shared_lib/test_inference.cc
+++ b/onnxruntime/test/shared_lib/test_inference.cc
@@ -184,7 +184,7 @@ TEST(CApiTest, dim_param) {
   ASSERT_EQ(strcmp(dim_param, ""), 0);
 }
 
-INSTANTIATE_TEST_SUITE_P(CApiTestWithProviders,
+INSTANTIATE_TEST_CASE_P(CApiTestWithProviders,
                         CApiTestWithProvider,
                         ::testing::Values(0, 1, 2, 3, 4));