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

VCPKG improvements #23688

Merged
merged 20 commits into from
Feb 14, 2025
Merged

VCPKG improvements #23688

merged 20 commits into from
Feb 14, 2025

Conversation

snnn
Copy link
Member

@snnn snnn commented Feb 13, 2025

Description

  1. Enabling wasm build.
  2. Because the above, I need to delete all the existing vcpkg triplet files and use build.py to generate on-the-fly.
  3. Updated onnx vcpkg port, to align with the latest changes in the upstream vcpkg repo.
  4. Disabling downloading protoc when onnxruntime_USE_VCPKG is true.
  5. Added "-e SYSTEM_COLLECTIONURI" to all "docker run " commands, so that in the docker instance I can use this information to determine if the build is running in an ONNX Runtime's team ADO project.
  6. Disable vcpkg asset caching if the build is not running in an ONNX Runtime's team ADO project.
  7. Add coreml-ep and dml-ep as ONNX Runtime package's features to "cmake/vcpkg.json"
  8. Add VCPKG to tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile , which is used by MIGRAPHX CI build pipeline.

Motivation and Context

This PR appears large because there were a lot of generated vcpkg triplet files checked in to this repo. This PR deletes them. Here are the reasons:

The official vcpkg repository has about 80 different triplets. But ONNX Runtime has many more build variants. For example, in general, for each platform, we need to support builds with C++ exceptions, builds without C++ exceptions, builds with C++ RTTI, builds without C++ RTTI, linking to static C++ runtime, linking to dynamic (shared) C++ runtime, builds with address sanitizer, builds without address sanitizer, etc. Therefore, a script file was created to dynamically generate the triplet files on-the-fly.

Originally, we tried to check in all the generated files into our repository so that people could build onnxruntime without using build.py or any other Python scripts in the "/tools" directory. However, we encountered an issue when adding support for WASM builds. VCPKG has a limitation that when doing cross-compiling, the triplet file must specify the full path of the chain-loaded toolchain file. The file needs to be located either via environment variables (like ANDROID_NDK_HOME) or via an absolute path. Since environment variables are hard to track, we chose the latter approach. So the generated triplet files may contain absolute file paths that are only valid on the current build machine.

@snnn snnn marked this pull request as ready for review February 14, 2025 16:10
@snnn snnn merged commit 1cd7981 into main Feb 14, 2025
95 of 98 checks passed
@snnn snnn deleted the snnn/vcpkg branch February 14, 2025 21:52
@zzaahhrraa1994
Copy link

I have a neural network model with h5 extension which I have converted to ONNX extension model. Now I want to load it in Qt creator with MinGW64 compiler and qmake. But when I add ONNX Runtime libraries to the project they are incompatible with MinGW64 compiler. How can I solve this problem?

@snnn
Copy link
Member Author

snnn commented Feb 17, 2025

Sorry It does not support MinGW's compilers. I don't have experiences with the environment. You may use Visual Studio instead.

@zzaahhrraa1994
Copy link

zzaahhrraa1994 commented Feb 17, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants