microsoft / microsoft/onnxruntime
[Build] Error is encountered when Building with Openvino EP
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 184
Description
### Describe the issue
Error is encountered when Building with Openvino EP
### Urgency
A little urgency.
### Target platform
Linux-rhel8.2
### Build script
Build Command
```
./build.sh --config RelWithDebInfo --use_openvino CPU --build_shared_lib --skip_submodule_sync
2025-04-22 16:26:36,642 build [DEBUG] - Command line arguments:
--build_dir /tools/onnxruntime/build/Linux --config RelWithDebInfo --use_openvino CPU --build_shared_lib --skip_submodule_sync
Namespace(acl_home=None, acl_libs=None, allow_running_as_root=False, android=False, android_abi='arm64-v8a', android_api=27, android_cpp_shared=False, android_ndk_path='', android_run_emulator=False, android_sdk_path='', apple_deploy_target=None, apple_sysroot='', arm=False, arm64=False, arm64ec=False, armnn_bn=False, armnn_home=None, armnn_libs=None, armnn_relu=False, build=False, build_apple_framework=False, build_csharp=False, build_dir='/onnxruntime/build/Linux', build_java=False, build_micro_benchmarks=False, build_nodejs=False, build_nuget=False, build_objc=False, build_shared_lib=True, build_wasm=False, build_wasm_static_lib=False, build_wheel=False, buildasx=False, cann_home=None, clean=False, cmake_extra_defines=None, cmake_generator=None, cmake_path='cmake', code_coverage=False, compile_no_warning_as_error=False, config=['RelWithDebInfo'], ctest_path='ctest', cuda_home=None, cuda_version=None, cudnn_home=None, disable_contrib_ops=False, disable_cuda_nhwc_ops=False, disable_exceptions=False, disable_memleak_checker=False, disable_ml_ops=False, disable_rtti=False, disable_types=[], disable_wasm_exception_catching=False, dml_external_project=False, dml_path='', dnnl_aarch64_runtime='', dnnl_acl_root='', dnnl_gpu_runtime='', dnnl_opencl_root='', eigen_path=None, emscripten_settings=None, emsdk_version='4.0.3', enable_address_sanitizer=False, enable_cuda_line_info=False, enable_cuda_minimal_build=False, enable_cuda_nhwc_ops=False, enable_cuda_profiling=False, enable_external_custom_op_schemas=False, enable_generic_interface=False, enable_lazy_tensor=False, enable_lto=False, enable_memory_profile=False, enable_msinternal=False, enable_msvc_static_runtime=False, enable_nccl=False, enable_nvtx_profile=False, enable_onnx_tests=False, enable_pix_capture=False, enable_pybind=False, enable_reduced_operator_type_support=False, enable_rocm_profiling=False, enable_symbolic_shape_infer_tests=False, enable_training=False, enable_training_apis=False, enable_training_ops=False, enable_transformers_tool_test=False, enable_wasm_api_exception_catching=False, enable_wasm_debug_info=False, enable_wasm_exception_throwing_override=True, enable_wasm_memory64=False, enable_wasm_profiling=False, enable_wasm_simd=False, enable_wasm_threads=False, enable_wcos=False, extensions_overridden_path=None, external_graph_transformer_path=None, fuzz_testing=False, gdk_edition='.', gdk_platform='Scarlett', gen_api_doc=False, gen_doc=None, include_ops_by_config=None, ios=False, ios_toolchain_file='', macos=None, migraphx_home=None, minimal_build=None, mpi_home=None, ms_experimental=False, msbuild_extra_options=None, msvc_toolset=None, nccl_home=None, nnapi_min_api=None, nvcc_threads=-1, osx_arch='x86_64', parallel=1, path_to_protoc_exe=None, qnn_home=None, riscv_qemu_path='', riscv_toolchain_root='', rocm_home=None, rocm_version=None, rv64=False, skip_keras_test=False, skip_nodejs_tests=False, skip_onnx_tests=False, skip_submodule_sync=True, skip_tests=False, skip_winml_tests=False, snpe_root=None, target=None, tensorrt_home=None, test=False, test_all_timeout='10800', update=False, use_acl=False, use_armnn=False, use_avx512=False, use_azure=False, use_binskim_compliant_compile_flags=False, use_cache=False, use_cann=False, use_coreml=False, use_cuda=False, use_dml=False, use_dnnl=False, use_extensions=False, use_external_dawn=False, use_full_protobuf=False, use_gdk=False, use_jsep=False, use_lock_free_queue=False, use_migraphx=False, use_mimalloc=False, use_mpi=False, use_nnapi=False, use_openvino='CPU', use_preinstalled_eigen=False, use_qnn=None, use_rknpu=False, use_rocm=False, use_snpe=False, use_telemetry=False, use_tensorrt=False, use_tensorrt_builtin_parser=True, use_tensorrt_oss_parser=False, use_triton_kernel=False, use_vcpkg=False, use_vcpkg_ms_internal_asset_cache=False, use_vitisai=False, use_vsinpu=False, use_webgpu=False, use_webnn=False, use_winml=False, use_xnnpack=False, visionos=False, visionos_toolchain_file='', wasm_malloc=None, wasm_run_tests_in_browser=False, wheel_name_suffix=None, windows_sdk_version=None, winml_root_namespace_override=None, x86=False, xcode_code_signing_identity='', xcode_code_signing_team_id='')
2025-04-22 16:26:36,649 build [DEBUG] - Defaulting to running update, build [and test for native builds].
2025-04-22 16:26:36,649 build [INFO] - Build started
2025-04-22 16:26:36,649 build [INFO] - Generating CMake build tree
2025-04-22 16:26:36,650 build [INFO] - /opt/cmake-3.28.0/bin/cmake /tools/onnxruntime/cmake -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_GENERATE_TEST_REPORTS=ON -DPython_EXECUTABLE=/usr/bin/python3 -Donnxruntime_USE_VCPKG=OFF -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_VSINPU=OFF -Donnxruntime_USE_RKNPU=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_VITISAI=OFF -Donnxruntime_USE_TENSORRT=OFF -Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON -Donnxruntime_USE_TENSORRT_INTERFACE=OFF -Donnxruntime_USE_CUDA_INTERFACE=OFF -Donnxruntime_USE_OPENVINO_INTERFACE=OFF -Donnxruntime_USE_VITISAI_INTERFACE=OFF -Donnxruntime_USE_QNN_INTERFACE=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_USE_DML=OFF -Donnxruntime_USE_WINML=OFF -Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF -Donnxruntime_USE_TELEMETRY=OFF -Donnxruntime_ENABLE_LTO=OFF -Donnxruntime_USE_ACL=OFF -Donnxruntime_USE_ARMNN=OFF -Donnxruntime_ARMNN_RELU_USE_CPU=ON -Donnxruntime_ARMNN_BN_USE_CPU=ON -Donnxruntime_USE_JSEP=OFF -Donnxruntime_USE_WEBGPU=OFF -Donnxruntime_ENABLE_PIX_FOR_WEBGPU_EP=OFF -Donnxruntime_USE_EXTERNAL_DAWN=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_USE_CUDA_NHWC_OPS=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_MEMORY64=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_WEBNN=OFF -Donnxruntime_USE_CANN=OFF -Donnxruntime_USE_TRITON_KERNEL=OFF -Donnxruntime_DISABLE_FLOAT8_TYPES=OFF -Donnxruntime_DISABLE_SPARSE_TENSORS=OFF -Donnxruntime_DISABLE_OPTIONAL_TYPE=OFF -Donnxruntime_CUDA_MINIMAL=OFF -Donnxruntime_USE_OPENVINO=ON -Donnxruntime_NPU_NO_FALLBACK=OFF -Donnxruntime_USE_OPENVINO_GPU=OFF -Donnxruntime_USE_OPENVINO_CPU=ON -Donnxruntime_USE_OPENVINO_NPU=OFF -Donnxruntime_USE_OPENVINO_GPU_NP=OFF -Donnxruntime_USE_OPENVINO_CPU_NP=OFF -Donnxruntime_USE_OPENVINO_NPU_NP=OFF -Donnxruntime_USE_OPENVINO_HETERO=OFF -Donnxruntime_USE_OPENVINO_DEVICE=CPU -Donnxruntime_USE_OPENVINO_MULTI=OFF -Donnxruntime_USE_OPENVINO_AUTO=OFF -Donnxruntime_USE_FULL_PROTOBUF=ON -DProtobuf_USE_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
```
Summary
```
-- ******** Summary ********
-- CMake version : 3.28.0
-- CMake command : /opt/cmake-3.28.0/bin/cmake
-- System : Linux
-- C++ compiler : /opt/gcc-9/bin/g++
-- C++ compiler version : 9.5.0
-- CXX flags : -ffunction-sections -fdata-sections -DCPUINFO_SUPPORTED -Wnon-virtual-dtor
-- Build type : RelWithDebInfo
-- Compile definitions : EIGEN_MPL2_ONLY;_GNU_SOURCE;__STDC_FORMAT_MACROS
-- CMAKE_PREFIX_PATH :
-- CMAKE_INSTALL_PREFIX : /usr/local
-- CMAKE_MODULE_PATH :/tools/onnxruntime/cmake/external
--
-- ONNX version : 1.17.0
-- ONNX NAMESPACE : onnx
-- ONNX_USE_LITE_PROTO : OFF
-- USE_PROTOBUF_SHARED_LIBS : OFF
-- Protobuf_USE_STATIC_LIBS : ON
-- ONNX_DISABLE_EXCEPTIONS : OFF
-- ONNX_DISABLE_STATIC_REGISTRATION : OFF
-- ONNX_WERROR : OFF
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_SHARED_LIBS :
-- BUILD_SHARED_LIBS : OFF
--
-- Protobuf compiler :
-- Protobuf includes :
-- Protobuf libraries :
-- BUILD_ONNX_PYTHON : OFF
```
### Error / output
Result
```bash
[ 63%] Building CXX object CMakeFiles/onnxruntime_providers_openvino.dir/tools/onnxruntime/onnxruntime/core/providers/openvino/backend_manager.cc.o
In file included from
/tools/onnxruntime/onnxruntime/core/providers/openvino/backend_manager.cc:17:
/tools/onnxruntime/onnxruntime/core/providers/openvino/contexts.h:30:45: error: ‘bool onnxruntime::openvino_ep::SharedContext::SharedWeights::Metadata::Key::operator==(const onnxruntime::openvino_ep::SharedContext::SharedWeights::Metadata::Key&) const’ cannot be defaulted
30 | bool operator==(const Key&) const = default;
| ^~~~~~~
gmake[2]: *** [CMakeFiles/onnxruntime_providers_openvino.dir/build.make:76: CMakeFiles/onnxruntime_providers_openvino.dir/tools/onnxruntime/onnxruntime/core/providers/openvino/backend_manager.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1474: CMakeFiles/onnxruntime_providers_openvino.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Traceback (most recent call last):
File "/tools/onnxruntime/tools/ci_build/build.py", line 3332, in
sys.exit(main())
File "/tools/onnxruntime/tools/ci_build/build.py", line 3226, in main
build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
File "/tools/onnxruntime/tools/ci_build/build.py", line 2022, in build_targets
run_subprocess(cmd_args, env=env)
File "/tools/onnxruntime/tools/ci_build/build.py", line 907, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
File "/tools/onnxruntime/tools/python/util/run.py", line 50, in run
completed_process = subprocess.run(
File "/usr/local/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/cmake-3.28.0/bin/cmake', '--build', '/tools/onnxruntime/build/Linux/RelWithDebInfo', '--config', 'RelWithDebInfo']' returned non-zero exit status 2.
```
### Visual Studio Version
_No response_
### GCC / Compiler Version
9.5.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with onnxruntime/core/providers/openvino/contexts.h at the reported SharedContext::SharedWeights::Metadata::Key equality declaration, then reproduce the failure using the listed build.sh command on Linux RHEL 8.2 with GCC 9.5.0. Done means the OpenVINO CPU RelWithDebInfo shared-library build completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100