From e96537e92df27ba49ade535a40611bbcf6b5257b Mon Sep 17 00:00:00 2001 From: benjaminwan Date: Thu, 14 Oct 2021 16:26:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20onnxruntime=201.9.0=20=E9=9D=99=E6=80=81?= =?UTF-8?q?=E5=BA=93=E6=96=87=E4=BB=B6=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-onnxruntime-vs2019.bat | 32 ++++++++++--------- build-onnxruntime.sh | 2 ++ .../linux_macos/OnnxRuntimeConfig.cmake | 2 +- cmake/static/windows/OnnxRuntimeConfig.cmake | 2 +- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/build-onnxruntime-vs2019.bat b/build-onnxruntime-vs2019.bat index 436e4cc..ef479e9 100644 --- a/build-onnxruntime-vs2019.bat +++ b/build-onnxruntime-vs2019.bat @@ -13,22 +13,24 @@ GOTO:EOF :collectLibs cmake --build . --config Release --target install del /s/q install\*test*.exe -mkdir -p install-static\lib +mkdir install-static\lib xcopy install\include install-static\include /s /y /i -copy RELEASE\ONNXRUNTIME_SESSION.LIB install-static\lib -copy RELEASE\ONNXRUNTIME_OPTIMIZER.LIB install-static\lib -copy RELEASE\ONNXRUNTIME_PROVIDERS.LIB install-static\lib -copy RELEASE\ONNXRUNTIME_UTIL.LIB install-static\lib -copy RELEASE\ONNXRUNTIME_FRAMEWORK.LIB install-static\lib -copy RELEASE\ONNXRUNTIME_GRAPH.LIB install-static\lib -copy RELEASE\ONNXRUNTIME_COMMON.LIB install-static\lib -copy RELEASE\ONNXRUNTIME_MLAS.LIB install-static\lib -copy RELEASE\ONNXRUNTIME_FLATBUFFERS.LIB install-static\lib -copy EXTERNAL\ONNX\RELEASE\ONNX.LIB install-static\lib -copy EXTERNAL\ONNX\RELEASE\ONNX_PROTO.LIB install-static\lib -copy "EXTERNAL\PROTOBUF\CMAKE\RELEASE\LIBPROTOBUF-LITE.LIB" install-static\lib -copy EXTERNAL\RE2\RELEASE\RE2.LIB install-static\lib -copy EXTERNAL\FLATBUFFERS\RELEASE\FLATBUFFERS.LIB install-static\lib +copy Release\onnxruntime_session.lib install-static\lib +copy Release\onnxruntime_optimizer.lib install-static\lib +copy Release\onnxruntime_providers.lib install-static\lib +copy Release\onnxruntime_util.lib install-static\lib +copy Release\onnxruntime_framework.lib install-static\lib +copy Release\onnxruntime_graph.lib install-static\lib +copy Release\onnxruntime_common.lib install-static\lib +copy Release\onnxruntime_mlas.lib install-static\lib +copy Release\onnxruntime_flatbuffers.lib install-static\lib +copy external\onnx\Release\onnx.lib install-static\lib +copy external\onnx\Release\onnx_proto.lib install-static\lib +copy external\protobuf\cmake\Release\libprotobuf-lite.lib install-static\lib +copy external\re2\Release\re2.lib install-static\lib +copy external\flatbuffers\Release\flatbuffers.lib install-static\lib +copy external\pytorch_cpuinfo\Release\cpuinfo.lib install-static\lib +copy external\pytorch_cpuinfo\deps\clog\Release\clog.lib install-static\lib GOTO:EOF :cmakeParamsX64 diff --git a/build-onnxruntime.sh b/build-onnxruntime.sh index 3e9512b..ce5ce34 100755 --- a/build-onnxruntime.sh +++ b/build-onnxruntime.sh @@ -21,6 +21,8 @@ function collectLibs() { cp external/protobuf/cmake/libprotobuf-lite.a install-static/lib cp external/re2/libre2.a install-static/lib cp external/flatbuffers/libflatbuffers.a install-static/lib + cp external/pytorch_cpuinfo/libcpuinfo.a install-static/lib + cp external/pytorch_cpuinfo/deps/clog/libclog.a install-static/lib cp external/nsync/libnsync_cpp.a install-static/lib } diff --git a/cmake/static/linux_macos/OnnxRuntimeConfig.cmake b/cmake/static/linux_macos/OnnxRuntimeConfig.cmake index 798967c..a7565cc 100755 --- a/cmake/static/linux_macos/OnnxRuntimeConfig.cmake +++ b/cmake/static/linux_macos/OnnxRuntimeConfig.cmake @@ -1,4 +1,4 @@ set(OnnxRuntime_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/include") include_directories(${OnnxRuntime_INCLUDE_DIRS}) link_directories(${CMAKE_CURRENT_LIST_DIR}/lib) -set(OnnxRuntime_LIBS onnxruntime_session onnxruntime_optimizer onnxruntime_providers onnxruntime_util onnxruntime_framework onnxruntime_graph onnxruntime_common onnxruntime_mlas onnxruntime_flatbuffers onnx onnx_proto protobuf-lite re2 flatbuffers nsync_cpp) \ No newline at end of file +set(OnnxRuntime_LIBS onnxruntime_session onnxruntime_optimizer onnxruntime_providers onnxruntime_util onnxruntime_framework onnxruntime_graph onnxruntime_mlas onnxruntime_common onnxruntime_flatbuffers onnx onnx_proto protobuf-lite re2 flatbuffers cpuinfo clog nsync_cpp) \ No newline at end of file diff --git a/cmake/static/windows/OnnxRuntimeConfig.cmake b/cmake/static/windows/OnnxRuntimeConfig.cmake index 05dc03e..14391a8 100755 --- a/cmake/static/windows/OnnxRuntimeConfig.cmake +++ b/cmake/static/windows/OnnxRuntimeConfig.cmake @@ -1,4 +1,4 @@ set(OnnxRuntime_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/include") include_directories(${OnnxRuntime_INCLUDE_DIRS}) link_directories(${CMAKE_CURRENT_LIST_DIR}/lib) -set(OnnxRuntime_LIBS onnxruntime_session onnxruntime_optimizer onnxruntime_providers onnxruntime_util onnxruntime_framework onnxruntime_graph onnxruntime_common onnxruntime_mlas onnxruntime_flatbuffers onnx onnx_proto libprotobuf-lite re2 flatbuffers) \ No newline at end of file +set(OnnxRuntime_LIBS onnxruntime_session onnxruntime_optimizer onnxruntime_providers onnxruntime_util onnxruntime_framework onnxruntime_graph onnxruntime_common onnxruntime_mlas onnxruntime_flatbuffers onnx onnx_proto libprotobuf-lite re2 flatbuffers cpuinfo clog) \ No newline at end of file