Skip to content

Support build on native Windows x64 #7217

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

Closed
wants to merge 3 commits into from

Conversation

chinazhangchao
Copy link
Contributor

@chinazhangchao chinazhangchao commented Dec 6, 2024

Summary

This PR is the first one of a series of PRs split from #6979 to support for out-of-the-box builds on Windows x64.

  1. (this one) make ./install_requirements.bat build and install executorch python package successfully, without xnnpack
  2. make ./install_requirements.bat --pybind xnnpack work
  3. Support examples/models/llama/

Test plan

PR tested by running minimal executor_runner example (https://pytorch.org/executorch/stable/getting-started-setup.html#run-your-program) in the following environment:

  • Windows 11 x64
  • Visual Studio Enterprise 2022 with these components installed:
    • C++ Clang tools for Windows
    • MSBuild support for LLVM (clang-cl) toolset
    • C++ CMake tools for Windows

Steps:

# run the following in command prompt
git clone -b win_build_basic https://github.com/vortex-captain/executorch.git
cd executorch/  # contains code of this PR
git submodule sync
git submodule update --init

./install_requirements.bat
python .\export_add.py  # export_add.py from https://pytorch.org/executorch/stable/getting-started-setup.html#export-a-program
msbuild pip-out\temp.win-amd64-cpython-310\cmake-out\executorch.sln /t:Rebuild
pip-out\temp.win-amd64-cpython-310\cmake-out\Debug\executor_runner.exe --model-path add.pte

References

#6979
#4681
#5252
#4899
#5164
#4993

Copy link

pytorch-bot bot commented Dec 6, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7217

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit a571e16 with merge base 63238ab (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 6, 2024
@chinazhangchao chinazhangchao changed the title Support build on native Windows Support build on native Windows x64 Dec 6, 2024
@chinazhangchao
Copy link
Contributor Author

@malfet @tarun292 @mcr229 @dbort @digantdesai Please help to review this PR which is split from #6979

@vortex-captain
Copy link

@pytorchbot label "release notes: build"

@pytorch-bot pytorch-bot bot added the release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. label Dec 6, 2024
@dbort dbort requested review from dbort and tarun292 December 6, 2024 18:18
@dbort
Copy link
Contributor

dbort commented Dec 6, 2024

Thank you for this PR! I'll take a look in the next couple of days. @tarun292 please also take a look; I'm not sure if we can assume that all windows users will be able to use clang-cl.

@vortex-captain
Copy link

Thank you for this PR! I'll take a look in the next couple of days. @tarun292 please also take a look; I'm not sure if we can assume that all windows users will be able to use clang-cl.

Thanks for your attention! Windows users can install clang-cl via winget like winget install --id llvm.llvm. Could we assume clang-cl is available to all users based on this?

@dbort dbort mentioned this pull request Jan 31, 2025
8 tasks
@ykhrustalev
Copy link
Contributor

Thank you for this PR! I'll take a look in the next couple of days. @tarun292 please also take a look; I'm not sure if we can assume that all windows users will be able to use clang-cl.

@dbort executorch codebase heavily uses compile flags that MSVS does not support , clang-cl is much easier to make working

@mtavenrath
Copy link

clang is part of the Visual Studio installer package. Installing it nothing mere that a single click in the visual studio installer. The cmdline option using winget is simple as well. As long as the build system notifies the user that clang is required I wouldn't consider clang only as blocker for this CL. If MSVC support is really required it still can be added in the long term.

@SS-JIA
Copy link
Contributor

SS-JIA commented Mar 17, 2025

Closing this PR now, as the changes contained in this PR are now merged as a part of the recent Windows support effort i.e. #9198

@SS-JIA SS-JIA closed this Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants