-
Notifications
You must be signed in to change notification settings - Fork 3k
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
CMake: Refactor Build Folder Structure #22622
base: fs-eire/webgpu-ep
Are you sure you want to change the base?
Conversation
Previous build scripts (e.g. build.bat) generate build folder with multi-config system as: - Nested config folders (e.g. build/Windows/Debug/Debug) - Multiple deps sources in each build config folders (e.g. build/Windows/Debug/_deps and build/Windows/Release/_deps) This PR refactors the build folder by: - Remove nested config folder structure and use single "bin", "lib" and "arch" folder for each configuration with multi config system. - Promote "_deps" folder from configuration folder to build root folder (e.g. From build/Windows/Debug/_deps to build/Windows/_deps). - Created new "deps" folder in each configuration folder. (e.g. build/Windows/Debug/deps). - The promoted _deps folder holds "deps_src" and "deps_download"(for old FetchContent behaviour). - The new created "deps" folder holds "deps_build" to avoid redundant build caused by configuration project file overridding. - A new command option in build.py to control whether update/download deps sources from remote url. It achieves: - No nested config folder structure in build folder. - Single deps sources for each build configuration to avoid redundant downloads and builds.
The PR tries not to do large changes on current
This behaviour has no proper flag to control ("DOWNLOAD_NO_EXTRACT" maybe but it requires extra extract process). I have to add a build flag Not sure any CMake experts could provide comments. My thoughts on this are:
WDYT? |
@microsoft-github-policy-service agree |
You can use https://github.com/microsoft/onnxruntime/blob/main/cmake/deps_update_and_upload.py to manually download artifacts. For example:
Then our cmake scripts will auto pick the files there, even if your switch to a different branch. It can achieve the goal of "Single deps sources for each build configuration to avoid redundant downloads and builds." Or you may also consider using vcpkg instead, which can even cache intermediate build files. Therefore I think there is no urgent need to do such a refactoring. |
@snnn Thanks for this info. So I think your suggestion is that we should always do deps update, and point the build script to the deps folder and then do build? |
You may use the following commands to build ONNX Runtime code:
The first one does not need to be run every time. |
Thanks for the suggestion. It indeed saving lots of download time but not meet my requirement 100%. For example, |
Previous build scripts (e.g. build.bat) generate build folder with multi-config system as:
This PR refactors the build folder by:
It achieves:
Description
Motivation and Context