Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ONNX v1.20 doesn't announce a protobuf dependency in the install interface #7510

@mschofie

Description

@mschofie

Bug Report

Is the issue related to model conversion?

This is not related to model conversion.

Describe the bug

When building ONNX with CMake, and building the install target, the v1.19.0 output included a dependency on protobuf targets, but the v1.20.0 output does not. As a result consuming ONNX from the install interface fails with unresolved externals in protobuf.

As an example, the v1.19.0 builds 'ONNXTargets.cmake' says:

# Create imported target ONNX::onnx_proto
add_library(ONNX::onnx_proto STATIC IMPORTED)

set_target_properties(ONNX::onnx_proto PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "ONNX_NAMESPACE=onnx;ONNX_ML=1"
  INTERFACE_COMPILE_OPTIONS "/wd4146;/wd4244;/wd4267;/wd4141"
  INTERFACE_LINK_LIBRARIES "protobuf::libprotobuf"
)

Note the protobuf::libprotobuf entry. In the v1.20.0 output, there's no mention of protobuf::libprotobuf. The ONNX::onnx_proto target is just:

# Create imported target ONNX::onnx_proto
add_library(ONNX::onnx_proto STATIC IMPORTED)

set_target_properties(ONNX::onnx_proto PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "ONNX_ML=1;ONNX_NAMESPACE=onnx"
)

This appears to be a regression introduced by #7087.

System information

  • CMake v4.2.0
  • ONNX @ tag v1.20.0

Reproduction instructions

Use cmake to confiugure, build and install ONNX. The generated 'ONNXTargets.cmake' does not announce a needed Protobuf dependency.

Expected behavior

The generated 'ONNXTargets.cmake' does announce a needed Protobuf dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtopic: buildIssues related to ONNX builds and packages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions