Skip to content

Commit

Permalink
fix: onnxruntime 1.9.0 静态库文件缺失
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminwan committed Oct 14, 2021
1 parent 4c77ca0 commit e96537e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
32 changes: 17 additions & 15 deletions build-onnxruntime-vs2019.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions build-onnxruntime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion cmake/static/linux_macos/OnnxRuntimeConfig.cmake
Original file line number Diff line number Diff line change
@@ -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)
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)
2 changes: 1 addition & 1 deletion cmake/static/windows/OnnxRuntimeConfig.cmake
Original file line number Diff line number Diff line change
@@ -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)
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)

0 comments on commit e96537e

Please sign in to comment.