Skip to content
New issue

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

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

Already on GitHub? # to your account

Correct ONNX and Protobuf version in vcpkg build #23285

Merged
merged 6 commits into from
Jan 8, 2025

Conversation

luncliff
Copy link
Contributor

@luncliff luncliff commented Jan 8, 2025

Description

Changes vcpkg manifest and configuration file (vcpkg.json & vcpkg-configuration.json)

However, onnx in vcpkg doesn't configure ONNX_DISABLE_STATIC_REGISTRATION build option.

  • [onnx] Add features to use ONNX build options vcpkg#38879
  • Create "cmake/vcpkg-triplets/" folder and triplet files which use VCPKG_CMAKE_CONFIGURE_OPTIONS for the option
    • This requires VCPKG_OVERLAY_TRIPLETS environment variable for CI steps, which is a bit inconvenient.
      I will try to find simple way to get same result

Motivation and Context

@luncliff luncliff marked this pull request as draft January 8, 2025 04:07
@luncliff luncliff marked this pull request as ready for review January 8, 2025 13:22
@snnn
Copy link
Member

snnn commented Jan 8, 2025

/azp run Big Models, Linux Android Emulator QNN CI Pipeline, Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline

@snnn
Copy link
Member

snnn commented Jan 8, 2025

/azp run Linux OpenVINO CI Pipeline, Linux QNN CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, Windows ARM64 QNN CI Pipeline, Windows CPU CI Pipeline, Windows GPU CUDA CI Pipeline

@snnn
Copy link
Member

snnn commented Jan 8, 2025

/azp run Windows GPU DML CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows x64 QNN CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline

Copy link

Azure Pipelines successfully started running 6 pipeline(s).

Copy link

Azure Pipelines successfully started running 5 pipeline(s).

Copy link

Azure Pipelines successfully started running 7 pipeline(s).

@snnn snnn added the build build issues; typically submitted using template label Jan 8, 2025
@snnn snnn self-requested a review January 8, 2025 18:03
@snnn snnn merged commit 5b9c968 into microsoft:main Jan 8, 2025
75 checks passed
{
"name": "nsync",
"platform": "!windows"
},
{
"name": "nsync",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luncliff , we no longer use nsync. This part can be removed.

Copy link
Contributor Author

@luncliff luncliff Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I saw #20413
I will remove the others before working on WebAssembly build

target_compile_options(nsync_cpp PRIVATE ${SMEMORY_FLAG} -Wno-experimental)

snnn pushed a commit that referenced this pull request Jan 8, 2025
### Description

Changes vcpkg manifest and configuration file (vcpkg.json &
vcpkg-configuration.json)

* Update vcpkg version to
https://github.com/microsoft/vcpkg/releases/tag/2024.12.16
* Use protobuf 3.21.12(= `v21.12`) to sync with
[cmake/deps.txt](https://github.com/microsoft/onnxruntime/blob/main/cmake/deps.txt)
  * Resolve #22750
* Add `onnx` to vcpkg manifest so `find_package(ONNX)` and
`find_dependency(Protobuf)` can work as expected.
  * Currently, It uses 1.16.2
* v1.17.0 will become available after
microsoft/vcpkg#42942

However, `onnx` in vcpkg doesn't configure
`ONNX_DISABLE_STATIC_REGISTRATION` build option.

* microsoft/vcpkg#38879
* Create "cmake/vcpkg-triplets/" folder and triplet files which use
`VCPKG_CMAKE_CONFIGURE_OPTIONS` for the option
* This requires `VCPKG_OVERLAY_TRIPLETS` environment variable for CI
steps, which is a bit inconvenient.
     I will try to find simple way to get same result

### Motivation and Context

* Help #23158 
  * "ONNX is not consumed from vcpkg"
* "Mismatch protobuf version. When vcpkg is enabled , we should not
fetch protoc from Github which may cause version mismatches."
* microsoft/vcpkg#43126
* #21348
@snnn
Copy link
Member

snnn commented Jan 9, 2025

@luncliff , the onnx port pulled in python3. Now we need to build python from source, for every platform. And python itself has a lot of dependencies. Can we avoid doing that?

@snnn
Copy link
Member

snnn commented Jan 9, 2025

Most developers would rather using a prebuilt python binary.

@luncliff luncliff deleted the support/vcpkg-onnx branch January 9, 2025 02:47
@luncliff
Copy link
Contributor Author

luncliff commented Jan 9, 2025

@luncliff , the onnx port pulled in python3. Now we need to build python from source, for every platform. And python itself has a lot of dependencies. Can we avoid doing that?

Yes. There is an alternative of using python3 port. I will suggest the change to vcpkg repository soon.

@snnn
Copy link
Member

snnn commented Jan 9, 2025

Thanks!

tarekziade pushed a commit to tarekziade/onnxruntime that referenced this pull request Jan 10, 2025
### Description

Changes vcpkg manifest and configuration file (vcpkg.json &
vcpkg-configuration.json)

* Update vcpkg version to
https://github.com/microsoft/vcpkg/releases/tag/2024.12.16
* Use protobuf 3.21.12(= `v21.12`) to sync with
[cmake/deps.txt](https://github.com/microsoft/onnxruntime/blob/main/cmake/deps.txt)
  * Resolve microsoft#22750
* Add `onnx` to vcpkg manifest so `find_package(ONNX)` and
`find_dependency(Protobuf)` can work as expected.
  * Currently, It uses 1.16.2
* v1.17.0 will become available after
microsoft/vcpkg#42942

However, `onnx` in vcpkg doesn't configure
`ONNX_DISABLE_STATIC_REGISTRATION` build option.

* microsoft/vcpkg#38879
* Create "cmake/vcpkg-triplets/" folder and triplet files which use
`VCPKG_CMAKE_CONFIGURE_OPTIONS` for the option
* This requires `VCPKG_OVERLAY_TRIPLETS` environment variable for CI
steps, which is a bit inconvenient.
     I will try to find simple way to get same result

### Motivation and Context

* Help microsoft#23158 
  * "ONNX is not consumed from vcpkg"
* "Mismatch protobuf version. When vcpkg is enabled , we should not
fetch protoc from Github which may cause version mismatches."
* microsoft/vcpkg#43126
* microsoft#21348
guschmue pushed a commit that referenced this pull request Jan 12, 2025
### Description

Changes vcpkg manifest and configuration file (vcpkg.json &
vcpkg-configuration.json)

* Update vcpkg version to
https://github.com/microsoft/vcpkg/releases/tag/2024.12.16
* Use protobuf 3.21.12(= `v21.12`) to sync with
[cmake/deps.txt](https://github.com/microsoft/onnxruntime/blob/main/cmake/deps.txt)
  * Resolve #22750
* Add `onnx` to vcpkg manifest so `find_package(ONNX)` and
`find_dependency(Protobuf)` can work as expected.
  * Currently, It uses 1.16.2
* v1.17.0 will become available after
microsoft/vcpkg#42942

However, `onnx` in vcpkg doesn't configure
`ONNX_DISABLE_STATIC_REGISTRATION` build option.

* microsoft/vcpkg#38879
* Create "cmake/vcpkg-triplets/" folder and triplet files which use
`VCPKG_CMAKE_CONFIGURE_OPTIONS` for the option
* This requires `VCPKG_OVERLAY_TRIPLETS` environment variable for CI
steps, which is a bit inconvenient.
     I will try to find simple way to get same result

### Motivation and Context

* Help #23158 
  * "ONNX is not consumed from vcpkg"
* "Mismatch protobuf version. When vcpkg is enabled , we should not
fetch protoc from Github which may cause version mismatches."
* microsoft/vcpkg#43126
* #21348
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Build] Build fails with vcpkg due to an incorrect protobuf version.
2 participants