Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Build onnxrunime from source on Windows failed #17675

Closed
18930215187 opened this issue Sep 23, 2023 · 12 comments
Closed

[Build] Build onnxrunime from source on Windows failed #17675

18930215187 opened this issue Sep 23, 2023 · 12 comments
Labels
build build issues; typically submitted using template ep:CUDA issues related to the CUDA execution provider ep:DML issues related to the DirectML execution provider ep:TensorRT issues related to TensorRT execution provider platform:windows issues related to the Windows platform

Comments

@18930215187
Copy link

18930215187 commented Sep 23, 2023

Describe the issue

Build onnxrunime from source on Windows failed (error LNK2019)
CUDA: 11.8.0_522.06 ( 12.2 on my PC too)
cuDNN: 8.7.0.84
TensorRT: 8.6.1.6
GPU: nvidia A4000

Urgency

2023/09/27

Target platform

Windows

Build script

git clone -b rel-1.15.1 --recursive https://github.com/Microsoft/onnxruntime
cd onnxruntime
./build.bat --build_shared_lib --config "MinSizeRel" --use_dml --use_cuda --use_tensorrt --parallel --skip_tests --compile_no_warning_as_error --cuda_home "G:\Environment\Device\CUDA\11.8" --cudnn_home "G:\Environment\Device\cuDNN" --tensorrt_home "G:\Environment\Device\tensorrt" --cmake_generator "Visual Studio 17 2022"

Error / output

PS G:\Environment\C\onnxruntime> ./build.bat --build_shared_lib --config "MinSizeRel" --use_dml --use_cuda --use_tensorrt --parallel --skip_tests  --compile_no_warning_as_error --cuda_home "G:\Environment\Device\CUDA\11.8" --cudnn_home "G:\Environment\Device\cuDNN" --tensorrt_home "G:\Environment\Device\tensorrt" --cmake_generator "Visual Studio 17 2022"
2023-09-23 12:50:06,910 build [DEBUG] - Command line arguments:
  --build_dir 'G:\Environment\C\onnxruntime\\build\Windows' --build_shared_lib --config MinSizeRel --use_dml --use_cuda --use_tensorrt --parallel --skip_tests --compile_no_warning_as_error --cuda_home 'G:\Environment\Device\CUDA\11.8' --cudnn_home 'G:\Environment\Device\cuDNN' --tensorrt_home 'G:\Environment\Device\tensorrt' --cmake_generator 'Visual Studio 17 2022'
2023-09-23 12:50:06,915 build [DEBUG] - Defaulting to running update, build [and test for native builds].
2023-09-23 12:50:06,920 build [INFO] - Build started
2023-09-23 12:50:06,920 util.run [INFO] - Running subprocess in 'G:\Environment\C\onnxruntime'
  git submodule sync --recursive
Synchronizing submodule url for 'cmake/external/eigen'
Synchronizing submodule url for 'cmake/external/emsdk'
Synchronizing submodule url for 'cmake/external/libprotobuf-mutator'
Synchronizing submodule url for 'cmake/external/onnx'
Synchronizing submodule url for 'cmake/external/onnx/third_party/benchmark'
Synchronizing submodule url for 'cmake/external/onnx/third_party/pybind11'
Synchronizing submodule url for 'cmake/external/onnxruntime-extensions'
2023-09-23 12:50:07,881 util.run [DEBUG] - Subprocess completed. Return code: 0
2023-09-23 12:50:07,882 util.run [INFO] - Running subprocess in 'G:\Environment\C\onnxruntime'
  git submodule update --init --recursive
2023-09-23 12:50:08,826 util.run [DEBUG] - Subprocess completed. Return code: 0
2023-09-23 12:50:08,827 build [INFO] - Generating CMake build tree
2023-09-23 12:50:08,828 util.run [INFO] - Running subprocess in 'G:\Environment\C\onnxruntime\\build\Windows\MinSizeRel'
  'G:\Environment\C\cmake\bin\cmake.EXE' 'G:\Environment\C\onnxruntime\cmake' --compile-no-warning-as-error -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_GENERATE_TEST_REPORTS=ON '-DPython_EXECUTABLE=G:\Environment\Anaconda\python.exe' '-DPYTHON_EXECUTABLE=G:\Environment\Anaconda\python.exe' -Donnxruntime_USE_MIMALLOC=OFF -Donnxruntime_ENABLE_PYTHON=OFF -Donnxruntime_BUILD_CSHARP=OFF -Donnxruntime_BUILD_JAVA=OFF -Donnxruntime_BUILD_NODEJS=OFF -Donnxruntime_BUILD_OBJC=OFF -Donnxruntime_BUILD_SHARED_LIB=ON -Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF -Donnxruntime_USE_DNNL=OFF -Donnxruntime_USE_NNAPI_BUILTIN=OFF -Donnxruntime_USE_RKNPU=OFF -Donnxruntime_USE_LLVM=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_VITISAI=OFF -Donnxruntime_USE_TENSORRT=ON -Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON -Donnxruntime_USE_TVM=OFF -Donnxruntime_TVM_CUDA_RUNTIME=OFF -Donnxruntime_TVM_USE_HASH=OFF -Donnxruntime_USE_MIGRAPHX=OFF -Donnxruntime_DISABLE_CONTRIB_OPS=OFF -Donnxruntime_DISABLE_ML_OPS=OFF -Donnxruntime_DISABLE_RTTI=OFF -Donnxruntime_DISABLE_EXCEPTIONS=OFF -Donnxruntime_MINIMAL_BUILD=OFF -Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF -Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF -Donnxruntime_REDUCED_OPS_BUILD=OFF -Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF -Donnxruntime_USE_DML=ON -Donnxruntime_USE_WINML=OFF -Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF -Donnxruntime_USE_TELEMETRY=OFF -Donnxruntime_ENABLE_LTO=OFF -Donnxruntime_USE_ACL=OFF -Donnxruntime_USE_ACL_1902=OFF -Donnxruntime_USE_ACL_1905=OFF -Donnxruntime_USE_ACL_1908=OFF -Donnxruntime_USE_ACL_2002=OFF -Donnxruntime_USE_ARMNN=OFF -Donnxruntime_ARMNN_RELU_USE_CPU=ON -Donnxruntime_ARMNN_BN_USE_CPU=ON -Donnxruntime_USE_JSEP=OFF -Donnxruntime_ENABLE_NVTX_PROFILE=OFF -Donnxruntime_ENABLE_TRAINING=OFF -Donnxruntime_ENABLE_TRAINING_OPS=OFF -Donnxruntime_ENABLE_TRAINING_APIS=OFF -Donnxruntime_ENABLE_CPU_FP16_OPS=OFF -Donnxruntime_USE_NCCL=OFF -Donnxruntime_BUILD_BENCHMARKS=OFF -Donnxruntime_USE_ROCM=OFF -DOnnxruntime_GCOV_COVERAGE=OFF -Donnxruntime_USE_MPI=OFF -Donnxruntime_ENABLE_MEMORY_PROFILE=OFF -Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF -Donnxruntime_BUILD_WEBASSEMBLY=OFF -Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON -Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON -Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF -Donnxruntime_ENABLE_LAZY_TENSOR=OFF -Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF -Donnxruntime_ENABLE_CUDA_PROFILING=OFF -Donnxruntime_ENABLE_ROCM_PROFILING=OFF -Donnxruntime_USE_XNNPACK=OFF -Donnxruntime_USE_CANN=OFF -Donnxruntime_NVCC_THREADS=0 '-Donnxruntime_TENSORRT_HOME=G:\Environment\Device\tensorrt' -Donnxruntime_USE_FULL_PROTOBUF=ON -DProtobuf_USE_STATIC_LIBS=ON -DCMAKE_TLS_VERIFY=ON -DFETCHCONTENT_QUIET=OFF -Donnxruntime_USE_CUDA=ON '-Donnxruntime_CUDA_HOME=G:\Environment\Device\CUDA\11.8' '-Donnxruntime_CUDNN_HOME=G:\Environment\Device\cuDNN' -DONNX_USE_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dgtest_force_shared_crt=ON -Donnxruntime_PYBIND_EXPORT_OPSCHEMA=OFF -A x64 -T 'host=x64,cuda=G:\Environment\Device\CUDA\11.8' -G 'Visual Studio 17 2022' -Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF -DCMAKE_BUILD_TYPE=MinSizeRel '-DCMAKE_PREFIX_PATH=G:\Environment\C\onnxruntime\\build\Windows/MinSizeRel/installed'
Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
CMake Deprecation Warning at CMakeLists.txt:21 (cmake_policy):
  The OLD behavior for policy CMP0104 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Warning (dev) at CMakeLists.txt:52 (include):
  Policy CMP0145 is not set: The Dart and FindDart modules are removed.  Run
  "cmake --help-policy CMP0145" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at G:/Environment/C/cmake/share/cmake-3.27/Modules/Dart.cmake:47 (message):
  Policy CMP0145 is not set: The Dart and FindDart modules are removed.  Run
  "cmake --help-policy CMP0145" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  CMakeLists.txt:52 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at G:/Environment/C/cmake/share/cmake-3.27/Modules/Dart.cmake:57 (find_package):
  Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
  variables.  Run "cmake --help-policy CMP0144" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  CMake variable DART_ROOT is set to:

    DART_ROOT-NOTFOUND

  For compatibility, find_package is ignoring the variable, but code in a
  .cmake module might still use it.
Call Stack (most recent call first):
  CMakeLists.txt:52 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

Building ONNX Runtime for Windows 10 and newer
Patch found: G:/Environment/Device/Git/usr/bin/patch.exe
Loading Dependencies URLs ...
Loading Dependencies ...
-- Populating abseil_cpp
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/abseil_cpp-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/abseil_cpp-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/abseil_cpp-subbuild/CMakeLists.txt
-- Abseil source dir:G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/abseil_cpp-src
-- Populating date
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/date-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/date-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/date-subbuild/CMakeLists.txt
CMake Deprecation Warning at G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/date-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Populating nlohmann_json
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/nlohmann_json-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/nlohmann_json-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/nlohmann_json-subbuild/CMakeLists.txt
CMake Deprecation Warning at G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/nlohmann_json-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Using the single-header code from G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/nlohmann_json-src/single_include/
-- Populating mp11
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/mp11-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/mp11-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/mp11-subbuild/CMakeLists.txt
-- Populating safeint
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/safeint-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/safeint-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/safeint-subbuild/CMakeLists.txt
CMake Deprecation Warning at G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/safeint-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Populating gsl
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/gsl-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/gsl-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/gsl-subbuild/CMakeLists.txt
-- Populating flatbuffers
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/flatbuffers-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/flatbuffers-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/flatbuffers-subbuild/CMakeLists.txt
CMake Deprecation Warning at G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/flatbuffers-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Protobuf version: 3.21.12.0
-- Populating pytorch_cpuinfo
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/pytorch_cpuinfo-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/pytorch_cpuinfo-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/pytorch_cpuinfo-subbuild/CMakeLists.txt
CMake Deprecation Warning at G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/pytorch_cpuinfo-src/deps/clog/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Populating eigen
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/eigen-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/eigen-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/eigen-subbuild/CMakeLists.txt
-- Populating microsoft_wil
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/microsoft_wil-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/microsoft_wil-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/microsoft_wil-subbuild/CMakeLists.txt
-- Populating onnx
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/onnx-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/onnx-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/onnx-subbuild/CMakeLists.txt
CMake Deprecation Warning at G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/onnx-src/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning (dev) at G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/onnx-src/CMakeLists.txt:119 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

Generated: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/onnx-build/onnx/onnx-ml.proto
Generated: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/onnx-build/onnx/onnx-operators-ml.proto
Generated: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/onnx-build/onnx/onnx-data.proto
--
-- ******** Summary ********
--   CMake version             : 3.27.6
--   CMake command             : G:/Environment/C/cmake/bin/cmake.exe
--   System                    : Windows
--   C++ compiler              : G:/Environment/C/VisualStudio/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe
--   C++ compiler version      : 19.37.32824.0
--   CXX flags                 : /DWIN32 /D_WINDOWS /EHsc /EHsc /wd26812 /MP -DEIGEN_HAS_C99_MATH -DCPUINFO_SUPPORTED /std:c++17 /EHsc /wd26812
--   Build type                : MinSizeRel
--   Compile definitions       : ORT_ENABLE_STREAM;EIGEN_MPL2_ONLY;EIGEN_HAS_CONSTEXPR;EIGEN_HAS_VARIADIC_TEMPLATES;EIGEN_HAS_CXX11_MATH;EIGEN_HAS_CXX11_ATOMIC;EIGEN_STRONG_INLINE=inline;WINAPI_FAMILY=100;WINVER=0x0A00;_WIN32_WINNT=0x0A00;NTDDI_VERSION=0x0A000000;__STDC_FORMAT_MACROS
--   CMAKE_PREFIX_PATH         : G:\Environment\C\onnxruntime\\build\Windows/MinSizeRel/installed
--   CMAKE_INSTALL_PREFIX      : C:/Program Files/onnxruntime
--   CMAKE_MODULE_PATH         : G:/Environment/C/onnxruntime/cmake/external
--
--   ONNX version              : 1.14.0
--   ONNX NAMESPACE            : onnx
--   ONNX_USE_LITE_PROTO       : OFF
--   USE_PROTOBUF_SHARED_LIBS  : OFF
--   Protobuf_USE_STATIC_LIBS  : ON
--   ONNX_DISABLE_EXCEPTIONS   : OFF
--   ONNX_WERROR               : OFF
--   ONNX_BUILD_TESTS          : OFF
--   ONNX_BUILD_BENCHMARKS     : OFF
--
--   Protobuf compiler         : G:/Environment/C/vcpkg/installed/x64-windows/tools/protobuf/protoc.exe
--   Protobuf includes         : G:/Environment/C/vcpkg/installed/x64-windows/include
--   Protobuf libraries        : optimized;G:/Environment/C/vcpkg/installed/x64-windows/bin/libprotobuf.dll;debug;G:/Environment/C/vcpkg/installed/x64-windows/debug/bin/libprotobufd.dll
--   BUILD_ONNX_PYTHON         : OFF
Finished fetching external dependencies
-- CMAKE_CUDA_COMPILER_VERSION: 11.8.89
-- Enable flash attention for CUDA EP
CMake Warning at CMakeLists.txt:1475 (message):
  MPI and NCCL disabled on Win build.


CMake Warning (dev) at onnxruntime_mlas.cmake:587:
  Syntax Warning in cmake code at column 107

  Argument not separated from preceding token by whitespace.
Call Stack (most recent call first):
  CMakeLists.txt:1609 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Populating cutlass
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/cutlass-subbuild
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  1>Checking Build System
  1>
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/cutlass-subbuild/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/_deps/cutlass-subbuild/CMakeLists.txt
-- Found TensorRT headers at G:/Environment/Device/tensorrt/include
-- Find TensorRT libs at G:/Environment/Device/tensorrt/lib/nvinfer.lib;G:/Environment/Device/tensorrt/lib/nvinfer_plugin.lib;G:/Environment/Device/tensorrt/lib/nvonnxparser.lib
-- Configuring done (7.9s)
-- Generating done (1.2s)
-- Build files have been written to: G:/Environment/C/onnxruntime/build/Windows/MinSizeRel
2023-09-23 12:50:18,222 util.run [DEBUG] - Subprocess completed. Return code: 0
2023-09-23 12:50:18,222 util.run [INFO] - Running subprocess in 'G:\Environment\C\onnxruntime'
  'G:\Environment\C\cmake\bin\cmake.EXE' --build 'G:\Environment\C\onnxruntime\\build\Windows\MinSizeRel' --config MinSizeRel --target RESTORE_PACKAGES
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  Checking File Globs
  1>Checking Build System
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  Generating G:/Environment/C/onnxruntime/build/Windows/packages/Microsoft.AI.DirectML.1.12.0/bin/x64-win/DirectML.lib,
   G:/Environment/C/onnxruntime/build/Windows/packages/Microsoft.AI.DirectML.1.12.0/bin/x86-win/DirectML.lib, G:/Enviro
  nment/C/onnxruntime/build/Windows/packages/Microsoft.AI.DirectML.1.12.0/bin/arm-win/DirectML.lib, G:/Environment/C/on
  nxruntime/build/Windows/packages/Microsoft.AI.DirectML.1.12.0/bin/arm64-win/DirectML.lib
  packages.config 中列出的所有程序包均已安装。
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
2023-09-23 12:50:19,141 util.run [DEBUG] - Subprocess completed. Return code: 0
2023-09-23 12:50:19,142 build [INFO] - Building targets for MinSizeRel configuration
2023-09-23 12:50:19,142 util.run [INFO] - Running subprocess in 'G:\Environment\C\onnxruntime'
  'G:\Environment\C\cmake\bin\cmake.EXE' --build 'G:\Environment\C\onnxruntime\\build\Windows\MinSizeRel' --config MinSizeRel -- /maxcpucount:24 /nodeReuse:False /p:CL_MPCount=24
适用于 .NET Framework MSBuild 版本 17.7.2+d6990bcfa

  Checking File Globs
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  absl_log_severity.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\base\M
  inSizeRel\absl_log_severity.lib
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  absl_spinlock_wait.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\base\
  MinSizeRel\absl_spinlock_wait.lib
  custom_op_invalid_library.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\MinSizeRel\custom_op_inval
  id_library.dll
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  absl_time_zone.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\time\MinS
  izeRel\absl_time_zone.lib
  absl_raw_logging_internal.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\abs
  l\base\MinSizeRel\absl_raw_logging_internal.lib
  flatbuffers.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\flatbuffers-build\MinSizeRel\flatb
  uffers.lib
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  absl_bad_variant_access.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\
  types\MinSizeRel\absl_bad_variant_access.lib
  custom_op_get_const_input_test_library.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\MinSizeRel\cu
  stom_op_get_const_input_test_library.dll
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  absl_exponential_biased.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\
  profiling\MinSizeRel\absl_exponential_biased.lib
  absl_civil_time.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\time\Min
  SizeRel\absl_civil_time.lib
  absl_int128.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\numeric\MinS
  izeRel\absl_int128.lib
  Generating G:/Environment/C/onnxruntime/build/Windows/packages/Microsoft.AI.DirectML.1.12.0/bin/x64-win/DirectML.lib,
   G:/Environment/C/onnxruntime/build/Windows/packages/Microsoft.AI.DirectML.1.12.0/bin/x86-win/DirectML.lib, G:/Enviro
  nment/C/onnxruntime/build/Windows/packages/Microsoft.AI.DirectML.1.12.0/bin/arm-win/DirectML.lib, G:/Environment/C/on
  nxruntime/build/Windows/packages/Microsoft.AI.DirectML.1.12.0/bin/arm64-win/DirectML.lib
  absl_debugging_internal.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\
  debugging\MinSizeRel\absl_debugging_internal.lib
  absl_base.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\base\MinSizeRe
  l\absl_base.lib
  absl_stacktrace.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\debuggin
  g\MinSizeRel\absl_stacktrace.lib
  onnxruntime_providers_shared.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\MinSizeRel\onnxruntime_
  providers_shared.dll
  onnx_proto.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\onnx-build\MinSizeRel\onnx_proto.li
  b
  absl_throw_delegate.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\base
  \MinSizeRel\absl_throw_delegate.lib
  absl_cordz_functions.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\str
  ings\MinSizeRel\absl_cordz_functions.lib
  absl_bad_optional_access.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl
  \types\MinSizeRel\absl_bad_optional_access.lib
  absl_city.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\hash\MinSizeRe
  l\absl_city.lib
  absl_demangle_internal.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\d
  ebugging\MinSizeRel\absl_demangle_internal.lib
  absl_malloc_internal.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\bas
  e\MinSizeRel\absl_malloc_internal.lib
  onnx.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\onnx-build\MinSizeRel\onnx.lib
  absl_graphcycles_internal.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\abs
  l\synchronization\MinSizeRel\absl_graphcycles_internal.lib
  packages.config 中列出的所有程序包均已安装。
  absl_strings_internal.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\st
  rings\MinSizeRel\absl_strings_internal.lib
  absl_low_level_hash.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\hash
  \MinSizeRel\absl_low_level_hash.lib
  absl_strings.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\strings\Min
  SizeRel\absl_strings.lib
  absl_time.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\time\MinSizeRe
  l\absl_time.lib
  absl_symbolize.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\debugging
  \MinSizeRel\absl_symbolize.lib
  absl_synchronization.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\syn
  chronization\MinSizeRel\absl_synchronization.lib
  absl_hash.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\hash\MinSizeRe
  l\absl_hash.lib
  absl_cord_internal.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\strin
  gs\MinSizeRel\absl_cord_internal.lib
  absl_cordz_handle.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\string
  s\MinSizeRel\absl_cordz_handle.lib
  absl_hashtablez_sampler.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\
  container\MinSizeRel\absl_hashtablez_sampler.lib
  absl_raw_hash_set.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\contai
  ner\MinSizeRel\absl_raw_hash_set.lib
  absl_cordz_info.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\strings\
  MinSizeRel\absl_cordz_info.lib
  absl_cord.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\_deps\abseil_cpp-build\absl\strings\MinSiz
  eRel\absl_cord.lib
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  Building Custom Rule G:/Environment/C/onnxruntime/cmake/CMakeLists.txt
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
  test_execution_provider.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\MinSizeRel\test_execution_pr
  ovider.dll
  onnxruntime_providers_tensorrt.vcxproj -> G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\MinSizeRel\onnxruntim
  e_providers_tensorrt.dll
    正在创建库 G:/Environment/C/onnxruntime/build/Windows/MinSizeRel/MinSizeRel/onnxruntime_providers_cuda.lib 和对象 G:/Enviro
  nment/C/onnxruntime/build/Windows/MinSizeRel/MinSizeRel/onnxruntime_providers_cuda.exp
cuda_allocator.obj : error LNK2019: 无法解析的外部符号 "unsigned __int64 __cdecl absl::lts_20211102::hash_internal::CityHash64(c
har const *,unsigned __int64)" (?CityHash64@hash_internal@lts_20211102@absl@@YA_KPEBD_K@Z),函数 "private: static unsigned
 __int64 __cdecl absl::lts_20211102::hash_internal::MixingHashState::CombineContiguousImpl(unsigned __int64,unsigned ch
ar const *,unsigned __int64,struct std::integral_constant<int,8>)" (?CombineContiguousImpl@MixingHashState@hash_interna
l@lts_20211102@absl@@CA_K_KPEBE0U?$integral_constant@H$07@std@@@Z) 中引用了该符号 [G:\Environment\C\onnxruntime\build\Windows\
MinSizeRel\onnxruntime_providers_cuda.vcxproj]
cuda_allocator.obj : error LNK2019: 无法解析的外部符号 "private: static unsigned __int64 __cdecl absl::lts_20211102::hash_intern
al::MixingHashState::CombineLargeContiguousImpl64(unsigned __int64,unsigned char const *,unsigned __int64)" (?CombineLa
rgeContiguousImpl64@MixingHashState@hash_internal@lts_20211102@absl@@CA_K_KPEBE0@Z),函数 "private: static unsigned __int6
4 __cdecl absl::lts_20211102::hash_internal::MixingHashState::CombineContiguousImpl(unsigned __int64,unsigned char cons
t *,unsigned __int64,struct std::integral_constant<int,8>)" (?CombineContiguousImpl@MixingHashState@hash_internal@lts_2
0211102@absl@@CA_K_KPEBE0U?$integral_constant@H$07@std@@@Z) 中引用了该符号 [G:\Environment\C\onnxruntime\build\Windows\MinSize
Rel\onnxruntime_providers_cuda.vcxproj]
cuda_allocator.obj : error LNK2019: 无法解析的外部符号 "void __cdecl absl::lts_20211102::container_internal::ConvertDeletedToEmp
tyAndFullToDeleted(enum absl::lts_20211102::container_internal::ctrl_t *,unsigned __int64)" (?ConvertDeletedToEmptyAndF
ullToDeleted@container_internal@lts_20211102@absl@@YAXPEAW4ctrl_t@123@_K@Z),函数 "private: void __cdecl absl::lts_2021110
2::container_internal::raw_hash_set<struct absl::lts_20211102::container_internal::FlatHashSetPolicy<void *>,struct abs
l::lts_20211102::container_internal::HashEq<void *,void>::Hash,struct absl::lts_20211102::container_internal::HashEq<vo
id *,void>::Eq,class std::allocator<void *> >::drop_deletes_without_resize(void)" (?drop_deletes_without_resize@?$raw_h
ash_set@U?$FlatHashSetPolicy@PEAX@container_internal@lts_20211102@absl@@UHash@?$HashEq@PEAXX@234@UEq@6234@V?$allocator@
PEAX@std@@@container_internal@lts_20211102@absl@@AEAAXXZ) 中引用了该符号 [G:\Environment\C\onnxruntime\build\Windows\MinSizeRe
l\onnxruntime_providers_cuda.vcxproj]
cuda_allocator.obj : error LNK2019: 无法解析的外部符号 "struct absl::lts_20211102::container_internal::FindInfo __cdecl absl::lt
s_20211102::container_internal::find_first_non_full<void>(enum absl::lts_20211102::container_internal::ctrl_t const *,u
nsigned __int64,unsigned __int64)" (??$find_first_non_full@X@container_internal@lts_20211102@absl@@YA?AUFindInfo@012@PE
BW4ctrl_t@012@_K1@Z),函数 "private: void __cdecl absl::lts_20211102::container_internal::raw_hash_set<struct absl::lts_20
211102::container_internal::FlatHashSetPolicy<void *>,struct absl::lts_20211102::container_internal::HashEq<void *,void
>::Hash,struct absl::lts_20211102::container_internal::HashEq<void *,void>::Eq,class std::allocator<void *> >::drop_del
etes_without_resize(void)" (?drop_deletes_without_resize@?$raw_hash_set@U?$FlatHashSetPolicy@PEAX@container_internal@lt
s_20211102@absl@@UHash@?$HashEq@PEAXX@234@UEq@6234@V?$allocator@PEAX@std@@@container_internal@lts_20211102@absl@@AEAAXX
Z) 中引用了该符号 [G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\onnxruntime_providers_cuda.vcxproj]
cuda_allocator.obj : error LNK2019: 无法解析的外部符号 "private: static void const * const absl::lts_20211102::hash_internal::Mi
xingHashState::kSeed" (?kSeed@MixingHashState@hash_internal@lts_20211102@absl@@0QEBXEB),函数 "unsigned __int64 __cdecl ab
sl::lts_20211102::container_internal::DecomposeValue<struct absl::lts_20211102::container_internal::raw_hash_set<struct
 absl::lts_20211102::container_internal::FlatHashSetPolicy<void *>,struct absl::lts_20211102::container_internal::HashE
q<void *,void>::Hash,struct absl::lts_20211102::container_internal::HashEq<void *,void>::Eq,class std::allocator<void *
> >::HashElement,void * &>(struct absl::lts_20211102::container_internal::raw_hash_set<struct absl::lts_20211102::conta
iner_internal::FlatHashSetPolicy<void *>,struct absl::lts_20211102::container_internal::HashEq<void *,void>::Hash,struc
t absl::lts_20211102::container_internal::HashEq<void *,void>::Eq,class std::allocator<void *> >::HashElement &&,void *
 &)" (??$DecomposeValue@UHashElement@?$raw_hash_set@U?$FlatHashSetPolicy@PEAX@container_internal@lts_20211102@absl@@UHa
sh@?$HashEq@PEAXX@234@UEq@6234@V?$allocator@PEAX@std@@@container_internal@lts_20211102@absl@@AEAPEAX@container_internal
@lts_20211102@absl@@YA_K$$QEAUHashElement@?$raw_hash_set@U?$FlatHashSetPolicy@PEAX@container_internal@lts_20211102@absl
@@UHash@?$HashEq@PEAXX@234@UEq@6234@V?$allocator@PEAX@std@@@012@AEAPEAX@Z) 中引用了该符号 [G:\Environment\C\onnxruntime\build\
Windows\MinSizeRel\onnxruntime_providers_cuda.vcxproj]
cuda_execution_provider.obj : error LNK2019: 无法解析的外部符号 "enum absl::lts_20211102::container_internal::ctrl_t const * con
st absl::lts_20211102::container_internal::kEmptyGroup" (?kEmptyGroup@container_internal@lts_20211102@absl@@3QBW4ctrl_t
@123@B),函数 "class std::unique_ptr<class onnxruntime::CUDAExternalAllocator,struct std::default_delete<class onnxruntime
::CUDAExternalAllocator> > __cdecl std::make_unique<class onnxruntime::CUDAExternalAllocator,short &,char const * const
 &,void * const &,void * const &,void * const &,0>(short &,char const * const &,void * const &,void * const &,void * co
nst &)" (??$make_unique@VCUDAExternalAllocator@onnxruntime@@AEAFAEBQEBDAEBQEAXAEBQEAXAEBQEAX$0A@@std@@YA?AV?$unique_ptr
@VCUDAExternalAllocator@onnxruntime@@U?$default_delete@VCUDAExternalAllocator@onnxruntime@@@std@@@0@AEAFAEBQEBDAEBQEAX2
2@Z) 中引用了该符号 [G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\onnxruntime_providers_cuda.vcxproj]
conv_transpose.obj : error LNK2019: 无法解析的外部符号 "void __cdecl absl::lts_20211102::base_internal::ThrowStdOutOfRange(char
const *)" (?ThrowStdOutOfRange@base_internal@lts_20211102@absl@@YAXPEBD@Z),函数 "public: void __cdecl onnxruntime::ConvTr
ansposeAttributes::ComputePadsAndOutputShape(class onnxruntime::TensorShape,__int64,class absl::lts_20211102::InlinedVe
ctor<__int64,5,class std::allocator<__int64> > const &,class absl::lts_20211102::InlinedVector<__int64,5,class std::all
ocator<__int64> > const &,class absl::lts_20211102::InlinedVector<__int64,5,class std::allocator<__int64> > const &,cla
ss absl::lts_20211102::InlinedVector<__int64,5,class std::allocator<__int64> > const &,__int64,class absl::lts_20211102
::InlinedVector<__int64,10,class std::allocator<__int64> > *,class absl::lts_20211102::InlinedVector<__int64,5,class st
d::allocator<__int64> > *)const " (?ComputePadsAndOutputShape@ConvTransposeAttributes@onnxruntime@@QEBAXVTensorShape@2@
_JAEBV?$InlinedVector@_J$04V?$allocator@_J@std@@@lts_20211102@absl@@222_JPEAV?$InlinedVector@_J$09V?$allocator@_J@std@@
@56@PEAV456@@Z) 中引用了该符号 [G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\onnxruntime_providers_cuda.vcxproj]
pool.obj : error LNK2001: 无法解析的外部符号 "void __cdecl absl::lts_20211102::base_internal::ThrowStdOutOfRange(char const *)"
(?ThrowStdOutOfRange@base_internal@lts_20211102@absl@@YAXPEBD@Z) [G:\Environment\C\onnxruntime\build\Windows\MinSizeRel
\onnxruntime_providers_cuda.vcxproj]
split.obj : error LNK2001: 无法解析的外部符号 "void __cdecl absl::lts_20211102::base_internal::ThrowStdOutOfRange(char const *)"
 (?ThrowStdOutOfRange@base_internal@lts_20211102@absl@@YAXPEBD@Z) [G:\Environment\C\onnxruntime\build\Windows\MinSizeRe
l\onnxruntime_providers_cuda.vcxproj]
G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\MinSizeRel\onnxruntime_providers_cuda.dll : fatal error LNK1120:
7 个无法解析的外部命令 [G:\Environment\C\onnxruntime\build\Windows\MinSizeRel\onnxruntime_providers_cuda.vcxproj]
Traceback (most recent call last):
  File "G:\Environment\C\onnxruntime\\tools\ci_build\build.py", line 2599, in <module>
    sys.exit(main())
             ^^^^^^
  File "G:\Environment\C\onnxruntime\\tools\ci_build\build.py", line 2495, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "G:\Environment\C\onnxruntime\\tools\ci_build\build.py", line 1434, in build_targets
    run_subprocess(cmd_args, env=env)
  File "G:\Environment\C\onnxruntime\\tools\ci_build\build.py", line 781, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\Environment\C\onnxruntime\tools\python\util\run.py", line 49, in run
    completed_process = subprocess.run(
                        ^^^^^^^^^^^^^^^
  File "G:\Environment\Anaconda\Lib\subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['G:\\Environment\\C\\cmake\\bin\\cmake.EXE', '--build', 'G:\\Environment\\C\\onnxruntime\\\\build\\Windows\\MinSizeRel', '--config', 'MinSizeRel', '--', '/maxcpucount:24', '/nodeReuse:False', '/p:CL_MPCount=24']' returned non-zero exit status 1.

Visual Studio Version

17.7.4

GCC / Compiler Version

No response

@18930215187 18930215187 added the build build issues; typically submitted using template label Sep 23, 2023
@github-actions github-actions bot added ep:CUDA issues related to the CUDA execution provider ep:DML issues related to the DirectML execution provider ep:TensorRT issues related to TensorRT execution provider platform:windows issues related to the Windows platform labels Sep 23, 2023
@GentBinaku
Copy link

GentBinaku commented Sep 23, 2023

Same here for me libprotobuf-lite is causing lnk2005

@tianleiwu
Copy link
Contributor

@18930215187, Could you try rel-1.16.0? That version shall be good.

@GentBinaku
Copy link

GentBinaku commented Sep 24, 2023

@tianleiwu, Doesn't work for me still the same error I tried on 1.15.0

libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::internal::LogMessage::LogMessage(enum google::protobuf::LogLevel,char const *,int)" (??0LogMessage@internal@proto
buf@google@@QEAA@W4LogLevel@23@PEBDH@Z) already defined in libprotobuf-lite.lib(common.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::internal::LogMessage::~LogMessage(void)" (??1LogMessage@internal@protobuf@google@@QEAA@XZ) already defined in lib
protobuf-lite.lib(common.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: class google::protobuf::internal::LogMessage & __cdecl google::protobuf::internal::LogMessage::operator<<(char const *)" (??6LogMessage@int
ernal@protobuf@google@@QEAAAEAV0123@PEBD@Z) already defined in libprotobuf-lite.lib(common.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::LogFinisher::operator=(class google::protobuf::internal::LogMessage &)" (??4LogFinisher@internal@p
rotobuf@google@@QEAAXAEAVLogMessage@123@@Z) already defined in libprotobuf-lite.lib(common.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(class std::basic_string<char,struct std::char_traits<char>,class std::allocato
r<char> > const &,class google::protobuf::Arena *)" (?Set@ArenaStringPtr@internal@protobuf@google@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z) already defined in lib
protobuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(char const *,class google::protobuf::Arena *)" (?Set@ArenaStringPtr@internal@p
rotobuf@google@@QEAAXPEBDPEAVArena@34@@Z) already defined in onnx.lib(defs.cc.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * __cdecl google::protobuf::internal::ArenaStringPt
r::Mutable(class google::protobuf::Arena *)" (?Mutable@ArenaStringPtr@internal@protobuf@google@@QEAAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z) already defined in libprot
obuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::ParseFromString(class std::basic_string<char,struct std::char_traits<char>,class std::allocator
<char> > const &)" (?ParseFromString@MessageLite@protobuf@google@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users
\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::SerializeToString(class std::basic_string<char,struct std::char_traits<char>,class std::allocat
or<char> > *)const " (?SerializeToString@MessageLite@protobuf@google@@QEBA_NPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\U
sers\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl google::protobuf::MessageLite::SerializeAsS
tring(void)const " (?SerializeAsString@MessageLite@protobuf@google@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\
GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "protected: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::DestroyProtos(void)" (?DestroyProtos@RepeatedPtrFieldBase@internal@protob
uf@google@@IEAAXXZ) already defined in libprotobuf-lite.lib(repeated_ptr_field.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: void * __cdecl google::protobuf::internal::RepeatedPtrFieldBase::AddOutOfLineHelper(void *)" (?AddOutOfLineHelper@RepeatedPtrFieldBase@int
ernal@protobuf@google@@AEAAPEAXPEAX@Z) already defined in libprotobuf-lite.lib(repeated_ptr_field.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::ParseFromZeroCopyStream(class google::protobuf::io::ZeroCopyInputStream *)" (?ParseFromZeroCopy
Stream@MessageLite@protobuf@google@@QEAA_NPEAVZeroCopyInputStream@io@23@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_
test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::io::FileInputStream::FileInputStream(int,int)" (??0FileInputStream@io@protobuf@google@@QEAA@HH@Z) already defined
 in libprotobuf-lite.lib(zero_copy_stream_impl.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::io::FileInputStream::~FileInputStream(void)" (??1FileInputStream@io@protobuf@google@@UEAA@XZ) already def
ined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(class std::basic_string<char,struct std::char_traits<char>,class std::allocato
r<char> > &&,class google::protobuf::Arena *)" (?Set@ArenaStringPtr@internal@protobuf@google@@QEAAX$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z) already defined in libpro
tobuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "void __cdecl google::protobuf::ShutdownProtobufLibrary(void)" (?ShutdownProtobufLibrary@protobuf@google@@YAXXZ) already defined in libprotobuf-lite
.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::io::CodedInputStream::~CodedInputStream(void)" (??1CodedInputStream@io@protobuf@google@@QEAA@XZ) already defined
in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: int __cdecl google::protobuf::io::CodedInputStream::PushLimit(int)" (?PushLimit@CodedInputStream@io@protobuf@google@@QEAAHH@Z) already defi
ned in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::io::CodedInputStream::PopLimit(int)" (?PopLimit@CodedInputStream@io@protobuf@google@@QEAAXH@Z) already defin
ed in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::MergeFromCodedStream(class google::protobuf::io::CodedInputStream *)" (?MergeFromCodedStream@Me
ssageLite@protobuf@google@@QEAA_NPEAVCodedInputStream@io@23@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcx
proj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::ParseFromArray(void const *,int)" (?ParseFromArray@MessageLite@protobuf@google@@QEAA_NPEBXH@Z)
already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::SerializeToOstream(class std::basic_ostream<char,struct std::char_traits<char> > *)const " (?Se
rializeToOstream@MessageLite@protobuf@google@@QEBA_NPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Window
s\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "void __cdecl google::protobuf::internal::GenericSwap(class google::protobuf::MessageLite *,class google::protobuf::MessageLite *)" (?GenericSwap@in
ternal@protobuf@google@@YAXPEAVMessageLite@23@0@Z) already defined in libprotobuf-lite.lib(generated_message_util.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxpro
j]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Destroy(void)" (?Destroy@ArenaStringPtr@internal@protobuf@google@@QEAAXXZ) already
 defined in libprotobuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "protected: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::CloseGap(int,int)" (?CloseGap@RepeatedPtrFieldBase@internal@protobuf@goog
le@@IEAAXHH@Z) already defined in libprotobuf-lite.lib(repeated_ptr_field.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::SerializeToZeroCopyStream(class google::protobuf::io::ZeroCopyOutputStream *)const " (?Serializ
eToZeroCopyStream@MessageLite@protobuf@google@@QEBA_NPEAVZeroCopyOutputStream@io@23@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\
onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::io::CopyingOutputStreamAdaptor::Flush(void)" (?Flush@CopyingOutputStreamAdaptor@io@protobuf@google@@QEAA_NXZ
) already defined in libprotobuf-lite.lib(zero_copy_stream_impl_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::io::FileOutputStream::FileOutputStream(int,int)" (??0FileOutputStream@io@protobuf@google@@QEAA@HH@Z) already defi
ned in libprotobuf-lite.lib(zero_copy_stream_impl.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::io::FileOutputStream::~FileOutputStream(void)" (??1FileOutputStream@io@protobuf@google@@UEAA@XZ) already
defined in libprotobuf-lite.lib(zero_copy_stream_impl.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::io::IstreamInputStream::IstreamInputStream(class std::basic_istream<char,struct std::char_traits<char> > *,int)"
(??0IstreamInputStream@io@protobuf@google@@QEAA@PEAV?$basic_istream@DU?$char_traits@D@std@@@std@@H@Z) already defined in libprotobuf-lite.lib(zero_copy_stream_impl.obj) [C:\Users\GentBinaku\onnxruntime\build\
Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::io::IstreamInputStream::~IstreamInputStream(void)" (??1IstreamInputStream@io@protobuf@google@@UEAA@XZ) al
ready defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "protected: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::Reserve(int)" (?Reserve@RepeatedPtrFieldBase@internal@protobuf@google@@IE
AAXH@Z) already defined in libprotobuf-lite.lib(repeated_ptr_field.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliased(unsigned int,class std::basic_string<char,struct
 std::char_traits<char>,class std::allocator<char> > const &,unsigned char *)" (?WriteStringMaybeAliased@EpsCopyOutputStream@io@protobuf@google@@QEAAPEAEIAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator
@D@2@@std@@PEAE@Z) already defined in onnx_proto.lib(onnx-ml.pb.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::EnsureSpaceFallback(unsigned char *)" (?EnsureSpaceFallback@EpsCopyOutp
utStream@io@protobuf@google@@AEAAPEAEPEAE@Z) already defined in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteRawFallback(void const *,int,unsigned char *)" (?WriteRawFallback@
EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEPEBXHPEAE@Z) already defined in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxpro
j]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteStringOutline(unsigned int,class std::basic_string<char,struct std
::char_traits<char>,class std::allocator<char> > const &,unsigned char *)" (?WriteStringOutline@EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEIAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std
@@PEAE@Z) already defined in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: static unsigned char * __cdecl google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(unsigned int,unsigned char *)" (?WriteVarint32
ToArray@CodedOutputStream@io@protobuf@google@@SAPEAEIPEAE@Z) already defined in libprotobuf-lite.lib(extension_set.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxpr
oj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: static unsigned char * __cdecl google::protobuf::io::CodedOutputStream::WriteVarint64ToArray(unsigned __int64,unsigned char *)" (?WriteVari
nt64ToArray@CodedOutputStream@io@protobuf@google@@SAPEAE_KPEAE@Z) already defined in libprotobuf-lite.lib(extension_set.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.
vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ThreadSafeArena::AddCleanup(void *,void (__cdecl*)(void *))" (?AddCleanup@ThreadSafeArena@internal
@protobuf@google@@QEAAXPEAXP6AX0@Z@Z) already defined in libprotobuf-lite.lib(arena.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: struct std::pair<void *,struct google::protobuf::internal::SerialArena::CleanupNode *> __cdecl google::protobuf::Arena::AllocateAlignedWit
hCleanup(unsigned __int64,class type_info const *)" (?AllocateAlignedWithCleanup@Arena@protobuf@google@@AEAA?AU?$pair@PEAXPEAUCleanupNode@SerialArena@internal@protobuf@google@@@std@@_KPEBVtype_info@@@Z) alrea
dy defined in libprotobuf-lite.lib(arena.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::ClearToEmpty(void)" (?ClearToEmpty@ArenaStringPtr@internal@protobuf@google@@QEAAXX
Z) already defined in libprotobuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: void __cdecl google::protobuf::internal::InternalMetadata::DoClear<class std::basic_string<char,struct std::char_traits<char>,class std::a
llocator<char> > >(void)" (??$DoClear@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@InternalMetadata@internal@protobuf@google@@AEAAXXZ) already defined in libprotobuf-lite.lib(message_lite.ob
j) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: void __cdecl google::protobuf::internal::InternalMetadata::DoMergeFrom<class std::basic_string<char,struct std::char_traits<char>,class st
d::allocator<char> > >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$DoMergeFrom@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Internal
Metadata@internal@protobuf@google@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Wi
ndows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::MessageLite::~MessageLite(void)" (??1MessageLite@protobuf@google@@UEAA@XZ) already defined in onnx_proto.
lib(onnx-ml.pb.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: static unsigned char * __cdecl google::protobuf::internal::WireFormatLite::InternalWriteMessage(int,class google::protobuf::MessageLite con
st &,int,unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)" (?InternalWriteMessage@WireFormatLite@internal@protobuf@google@@SAPEAEHAEBVMessageLite@34@HPEAEPEAVEpsCopyOutputStream@io@34@@Z) al
ready defined in libprotobuf-lite.lib(wire_format_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::Int64Size(class google::protobuf::RepeatedField<__int64> const
&)" (?Int64Size@WireFormatLite@internal@protobuf@google@@SA_KAEBV?$RepeatedField@_J@34@@Z) already defined in libprotobuf-lite.lib(wire_format_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithD
ebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "class google::protobuf::MessageLite * __cdecl google::protobuf::internal::GetOwnedMessageInternal(class google::protobuf::Arena *,class google::pro
tobuf::MessageLite *,class google::protobuf::Arena *)" (?GetOwnedMessageInternal@internal@protobuf@google@@YAPEAVMessageLite@23@PEAVArena@23@PEAV423@0@Z) already defined in libprotobuf-lite.lib(generated_mess
age_util.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: char const * __cdecl google::protobuf::internal::EpsCopyInputStream::ReadString(char const *,int,class std::basic_string<char,struct std::c
har_traits<char>,class std::allocator<char> > *)" (?ReadString@EpsCopyInputStream@internal@protobuf@google@@QEAAPEBDPEBDHPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in
 libprotobuf-lite.lib(extension_set.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: char const * __cdecl google::protobuf::internal::ParseContext::ParseMessage(class google::protobuf::MessageLite *,char const *)" (?ParseMes
sage@ParseContext@internal@protobuf@google@@QEAAPEBDPEAVMessageLite@34@PEBD@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxrunt
ime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: char const * __cdecl google::protobuf::internal::ParseContext::ReadSizeAndPushLimitAndDepth(char const *,int *)" (?ReadSizeAndPushLimitAnd
Depth@ParseContext@internal@protobuf@google@@AEAAPEBDPEBDPEAH@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.v
cxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "struct std::pair<char const *,unsigned __int64> __cdecl google::protobuf::internal::VarintParseSlow64(char const *,unsigned int)" (?VarintParseSlow
64@internal@protobuf@google@@YA?AU?$pair@PEBD_K@std@@PEBDI@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxp
roj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "struct std::pair<char const *,unsigned int> __cdecl google::protobuf::internal::ReadTagFallback(char const *,unsigned int)" (?ReadTagFallback@inter
nal@protobuf@google@@YA?AU?$pair@PEBDI@std@@PEBDI@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "struct std::pair<char const *,int> __cdecl google::protobuf::internal::ReadSizeFallback(char const *,unsigned int)" (?ReadSizeFallback@internal@pro
tobuf@google@@YA?AU?$pair@PEBDH@std@@PEBDI@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::InlineGreedyStringParser(class std::basic_string<char,struct std::char_traits<char>,class std::all
ocator<char> > *,char const *,class google::protobuf::internal::ParseContext *)" (?InlineGreedyStringParser@internal@protobuf@google@@YAPEBDPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEB
DPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::PackedInt64Parser(void *,char const *,class google::protobuf::internal::ParseContext *)" (?PackedI
nt64Parser@internal@protobuf@google@@YAPEBDPEAXPEBDPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime
_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::PackedFloatParser(void *,char const *,class google::protobuf::internal::ParseContext *)" (?PackedF
loatParser@internal@protobuf@google@@YAPEBDPEAXPEBDPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime
_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::PackedDoubleParser(void *,char const *,class google::protobuf::internal::ParseContext *)" (?Packed
DoubleParser@internal@protobuf@google@@YAPEBDPEAXPEBDPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxrunti
me_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::UnknownFieldParse(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class st
d::allocator<char> > *,char const *,class google::protobuf::internal::ParseContext *)" (?UnknownFieldParse@internal@protobuf@google@@YAPEBDIPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEB
DPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\RelWithDebInfo\onnxruntime_test_all.exe : fatal error LNK1169: one or more multiply defined symbols found [C:\Users\GentBinaku\onnxruntime\build\Wi
ndows\RelWithDebInfo\onnxruntime_test_all.vcxproj]


@18930215187
Copy link
Author

@18930215187, Could you try rel-1.16.0? That version shall be good.

I think I shouldn't try rel-1.16.0, because the rust crate named ort(unofficial) is not support onnxruntime 1.16.0 yet, but I will help you identify the problem by this way

@18930215187
Copy link
Author

18930215187 commented Sep 24, 2023

@18930215187, Could you try rel-1.16.0? That version shall be good.

@tianleiwu The same error occured

@kazssym
Copy link
Contributor

kazssym commented Sep 24, 2023

It looks like libprotobuf-lite.lib (static lib) contains its own DLL. It may cause duplicate symbols.

@18930215187
Copy link
Author

18930215187 commented Sep 24, 2023

It looks like libprotobuf-lite.lib (static lib) contains its own DLL. It may cause duplicate symbols.

@kazssym , How can I solve this problem?

@mszhanyi
Copy link
Contributor

Could you try adding -skip_submodule_sync

@18930215187
Copy link
Author

The same error occured

@mszhanyi The same error occured

@kazssym
Copy link
Contributor

kazssym commented Sep 25, 2023

It looks like libprotobuf-lite.lib (static lib) contains its own DLL. It may cause duplicate symbols.

@kazssym , How can I solve this problem?

Unfortunately, I don't know much about how the library was built. It probably requires to be rebuilt?

@snnn
Copy link
Member

snnn commented Sep 25, 2023

How about adding "--cmake_extra_defines FETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER" to your build command? If the problem still exists, please try to do the build in a clean docker container or a clean newly installed Windows machine.

@snnn
Copy link
Member

snnn commented Sep 25, 2023

You hit the issue because the protobuf was fetched from vcpkg

G:/Environment/C/vcpkg/installed/x64-windows/bin/libprotobuf.dll

However, its build config it incompatible with the other libs. Please do it without vcpkg.

@snnn snnn closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template ep:CUDA issues related to the CUDA execution provider ep:DML issues related to the DirectML execution provider ep:TensorRT issues related to TensorRT execution provider platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

6 participants