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] Better support for vcpkg #23158

Open
2 of 14 tasks
snnn opened this issue Dec 20, 2024 · 4 comments
Open
2 of 14 tasks

[Build] Better support for vcpkg #23158

snnn opened this issue Dec 20, 2024 · 4 comments
Labels
build build issues; typically submitted using template ep:Xnnpack issues related to XNNPACK EP platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@snnn
Copy link
Member

snnn commented Dec 20, 2024

Describe the issue

Thanks @luncliff for adding the support for vcpkg. Now it works for a very basic build. This issue is created for tracking the remaining issues when --use_vcpkg is enabled.

Contributions are welcomed. Or if you have any ideas or suggestions, please let us know. This issue is created for listening your feedbacks and suggestions.

Here is my dev branch: https://github.com/microsoft/onnxruntime/tree/snnn/vcpkg

@snnn snnn added the build build issues; typically submitted using template label Dec 20, 2024
@github-actions github-actions bot added ep:Xnnpack issues related to XNNPACK EP platform:web issues related to ONNX Runtime web; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template labels Dec 20, 2024
@luncliff
Copy link
Contributor

luncliff commented Dec 20, 2024 via email

@snnn
Copy link
Member Author

snnn commented Dec 20, 2024

You may directly create the PRs to main. Meanwhile, I will also gradually migrate our pull request pipelines from Azure DevOps to Github.

snnn added a commit that referenced this issue Dec 20, 2024
### Description
CMake's
[target_link_libraries](https://cmake.org/cmake/help/latest/command/target_link_libraries.html#id2)
function accepts plain library name(like `re2`) or target name(like
`re2::re2`) or some other kinds of names. "plain library names" are
old-fashioned, for compatibility only. We should use target names.

### Motivation and Context
To make vcpkg work with winml build. See #23158
snnn pushed a commit that referenced this issue 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 pushed a commit that referenced this issue 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
@shijunz
Copy link

shijunz commented Jan 10, 2025

VCPKG's toolchain file scripts/toolchains/windows.cmake doesn't support ARM64EC.

not , it is not true. actually it just for the opencv:arm64ec-windows-static, many others arm64ec-windows is passed.

tarekziade pushed a commit to tarekziade/onnxruntime that referenced this issue Jan 10, 2025
### Description
CMake's
[target_link_libraries](https://cmake.org/cmake/help/latest/command/target_link_libraries.html#id2)
function accepts plain library name(like `re2`) or target name(like
`re2::re2`) or some other kinds of names. "plain library names" are
old-fashioned, for compatibility only. We should use target names.

### Motivation and Context
To make vcpkg work with winml build. See microsoft#23158
tarekziade pushed a commit to tarekziade/onnxruntime that referenced this issue 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
@snnn
Copy link
Member Author

snnn commented Jan 10, 2025

arm64ec is a valid value of VCPKG_TARGET_ARCHITECTURE, but it is not handled in the switch case in https://github.com/microsoft/vcpkg/blob/master/scripts/toolchains/windows.cmake . Isn't a general problem?

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:Xnnpack issues related to XNNPACK EP platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants