Skip to content

[Build] Better support for vcpkg #23158

@snnn

Description

@snnn

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.

  • VCPKG's toolchain file scripts/toolchains/windows.cmake doesn't support ARM64EC. [opencv4] Build error on arm64ec-windows-static , because Compiler doesn't support baseline optimization flags: /arch:SSE /arch:SSE2 vcpkg#43181
  • ONNX is not consumed from vcpkg.
  • Windows ARM64 cross-compiling support. We need to build protoc for x64 and the rest of the code for ARM64. Which means we may need to run vcpkg install in classic mode first. Need to explore.
  • Add toolchain chain loader support
  • Apply local patches. We need to apply the patches in https://github.com/microsoft/onnxruntime/tree/main/cmake/patches folder when building with vcpkg, which means we need to create custom ports for them?
  • The cpuinfo library is the official vcpkg registry is too old, which doesn't work with the XNNPack version we are using. Sub issue: [Build] libXNNPACK.a not built when building with vcpkg and onnxruntime_BUILD_UNIT_TESTS=off #22789
  • winml_dll links to re2 instead of re2::re2 (Fix a tiny problem in winml.cmake #23173)
  • Similar to the above, ORT extension has a lot of similar issues. And we need to update the ORT extension version after fixing the issues. Fix re2 link onnxruntime-extensions#872
  • Mismatch protobuf version. When vcpkg is enabled , we should not fetch protoc from Github which may cause version mismatches.
  • BinSkim support. By default the packages are not built with Qspectre. It can be resolved by creating customized triplets for it.
  • WASM build has too many build options:
    - onnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO
    - onnxruntime_ENABLE_WEBASSEMBLY_SIMD
    - onnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING
    - onnxruntime_ENABLE_WEBASSEMBLY_MEMORY64
    - onnxruntime_ENABLE_WEBASSEMBLY_THREADS
    It leads to 2^5 = 32 different combinations. We will need to create 32 triplets for them.
  • [] Would iOS build be possible? I am not sure yet.
  • (low priority) Enable asset cache in CI
  • (low priority) Enable binary cache in CI
  • Minimal build uses a custom ONNX cmake file. Don't know how to deal with it yet
  • Need to add suport for MacOS Catalyst build
  • WebGPU Windows build does not work. Due to a wired "dir is already created" error

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildbuild issues; typically submitted using templateep:WebGPUort-web webgpu providerep:Xnnpackissues related to XNNPACK EPplatform:mobileissues related to ONNX Runtime mobile; typically submitted using templateplatform:webissues related to ONNX Runtime web; typically submitted using templatestaleissues that have not been addressed in a while; categorized by a bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions