-
Notifications
You must be signed in to change notification settings - Fork 545
Support build on native Windows #4661
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
Comments
Hi @python3kgae , thanks for submitting this issue and proposing the list of items. @daveboat and @malfet , does the list make sense to you? We are limited in resource on Windows. @python3kgae , are you willing to directly contribute to the ET windows build? We are happy to support/unblock you. |
Added install_requirements.ps1 for build on native Windows. Also fix issues block build on native Windows. 1. Get the Windows version of buck2 for Windows. 2. Check the path based on the build configuration for Windows in setup.py. 3. Avoid generating 'def flat.exe()' which is illegal python. 4. Add the Windows version of kernel_link_options. 5. Add links of pthreadpool and cpuinfo for custom_ops_aot_lib. 6. Define ssize_t for Windows. Still have one link issue tracked with pytorch#4659. For pytorch#4661
PR created. |
Move the details of install_requirements.sh into install_requirements.py. Then, call install_requirements.py from install_requirements.sh. This will avoid duplication when add Windows version of installing_requirements. This is for issue pytorch#4661.
Move the details of install_requirements.sh into install_requirements.py. Then, call install_requirements.py from install_requirements.sh. This will avoid duplication when add Windows version of installing_requirements. This is for issue pytorch#4661.
Move the details of install_requirements.sh into install_requirements.py. Then, call install_requirements.py from install_requirements.sh. This will avoid duplication when adding Windows version of installing_requirements. This is for issue #4661. Release Note: Moved the main install_requirements.sh logic into install_requirements.py so that it can also run on Windows. Test Plan: Tested on a mac. Ran `./install_requirements.sh --pybind xnnpack` under python 3.10, and it completed successfully. To make sure that xnnpack was actually installed, I manually ran the steps from the notebook at https://colab.research.google.com/drive/1qpxrXC3YdJQzly3mRg-4ayYiOjC6rue3, and it passed. When running the same in a clean python 3.8 environment, it failed as expected with ``` % ./install_requirements.sh --pybind xnnpack Collecting packaging Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB) Using cached packaging-24.1-py3-none-any.whl (53 kB) Installing collected packages: packaging Successfully installed packaging-24.1 ERROR: ExecuTorch does not support python version 3.8.19: must satisfy ">=3.10" ``` Also tested under WSL and native Windows.
Added install_requirements.ps1 for build on native Windows. Also fix issues block build on native Windows. 1. Get the Windows version of buck2 for Windows. 2. Check the path based on the build configuration for Windows in setup.py. 3. Avoid generating 'def flat.exe()' which is illegal python. 4. Add the Windows version of kernel_link_options. 5. Add links of pthreadpool and cpuinfo for custom_ops_aot_lib. 6. Define ssize_t for Windows. Still have one link issue tracked with pytorch#4659. For pytorch#4661
Add Windows support to BUCK_PLATFORM_MAP. Also use urllib.request.urlretrieve directly to work around PermissionError on Windows. For pytorch#4661
Fix windows build issues in setup.py 1. Build executable name and dynamic lib name based on platform. 2. Set the src directory based on build config for windows. 3. Avoid using os.geteuid() on windows. For pytorch#4661
Move size_t and ssize_t header to runtime/platform/compiler.h. Define ssize_t for windows as ptrdiff_t. For pytorch#4661
There is no direct replacement for libpthread.so on Windows. Link pthreadpool and cpuinfo staticly for windows. For pytorch#4661
Add install_requirements.bat on windows like install_requirements.sh. Also force use ClangCL on windows in install_requirements.py. For pytorch#4661
Windows executable will have .exe suffix. It will cause illegal python code `def flat.exe():` generated. This change fix the issue by remove the suffix. For pytorch#4661
Add msvc version of kernel_link_options. For pytorch#4661
Fix windows build issues in setup.py 1. Build executable name and dynamic lib name based on platform. 2. Set the src directory based on build config for windows. 3. Avoid using os.geteuid() on windows. For #4661
Add install_requirements.bat on windows like install_requirements.sh. Also force use ClangCL on windows in install_requirements.py. For #4661
Two build issues have been addressed in this pull request: 1. Avoid closing when fd_ is -1, as this would cause a crash on Windows. 2. Introduce separate headers for Windows and Unix, enabling Windows builds to utilize a distinct header and implement pread. For pytorch#4661
Two build issues have been addressed in this pull request: 1. Avoid closing when fd_ is -1, as this would cause a crash on Windows. 2. Introduce separate headers for Windows and Unix, enabling Windows builds to utilize a distinct header and implement pread. For pytorch#4661
The binary directory for Windows will have build type like Debug/Release at the end. For pytorch#4661
The basic_string_view constructor: ``` template< class It, class End > constexpr basic_string_view( It first, End last ); ``` requires C++20. To allow the code to compile with C++17, use the basic_string_view constructor: ``` constexpr basic_string_view( const CharT* s, size_type count ); ``` For pytorch#4661
…ble (#5025) The basic_string_view constructor: ``` template< class It, class End > constexpr basic_string_view( It first, End last ); ``` requires C++20. To allow the code to compile with C++17, use the basic_string_view constructor: ``` constexpr basic_string_view( const CharT* s, size_type count ); ``` For #4661
Two build issues have been addressed in this pull request: 1. Avoid closing when fd_ is -1, as this would cause a crash on Windows. 2. Introduce separate headers for Windows and Unix, enabling Windows builds to utilize a distinct header and implement pread. For pytorch#4661
Add Windows support to BUCK_PLATFORM_MAP. Also use urllib.request.urlretrieve directly to work around PermissionError on Windows. For pytorch#4661
Replace clock_gettime with timespec_get which works on Windows as well. For pytorch#4661
Set the src directory based on build configuration for windows. Rename _portable_lib.* to _portable_lib.cp* to avoid _portable_lib.lib is selected on windows. For pytorch#4661
Add Windows support to BUCK_PLATFORM_MAP. Also use urllib.request.urlretrieve directly to work around PermissionError on Windows. For pytorch#4661
Add Windows support to BUCK_PLATFORM_MAP. Also use urllib.request.urlretrieve directly to work around PermissionError on Windows. For pytorch#4661
* [Build] Support windows in resolve_buck.py Add Windows support to BUCK_PLATFORM_MAP. Also use urllib.request.urlretrieve directly to work around PermissionError on Windows. For #4661 * Update buck2 to2024-12-16 --------- Co-authored-by: Xiang Li <[email protected]>
likely need either a Windows-specific or standard C++ implementation of file_data_loader; it's full of Unix-specific syscalls |
There are a couple PRs out there adding windows support to the data loaders, though they've stalled out: |
Set the src directory based on build configuration for windows. Rename _portable_lib.* to _portable_lib.cp* to avoid _portable_lib.lib is selected on windows. For pytorch#4661
Set the src directory based on build configuration for windows. Rename _portable_lib.* to _portable_lib.cp* to avoid _portable_lib.lib is selected on windows. For pytorch#4661
Replace clock_gettime with timespec_get which works on Windows as well. For pytorch#4661
Replace clock_gettime with timespec_get which works on Windows as well. For #4661
Replace clock_gettime with timespec_get which works on Windows as well. For #4661
🚀 The feature, motivation and pitch
Currently, executorch supports Windows via WSL.
It would be beneficial to enable native Windows builds as well, as this would assist users who do not have WSL installed.
Alternatives
Executorch already supports Windows via WSL.
Additional context
No response
RFC (Optional)
The plan is to create a PowerShell version of install_requirements.sh.
Here is a list of things that need to be updated for building on native Windows:
The text was updated successfully, but these errors were encountered: