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

[Build] Add install_requirements.bat for windows build #4862

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions install_requirements.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@ECHO OFF

rem Copyright (c) Meta Platforms, Inc. and affiliates.
rem All rights reserved.

rem This batch file provides a basic functionality similar to the bash script.

cd /d "%~dp0"

rem Find the names of the python tools to use (replace with your actual python installation)
if "%PYTHON_EXECUTABLE%"=="" (
if "%CONDA_DEFAULT_ENV%"=="" OR "%CONDA_DEFAULT_ENV%"=="base" OR NOT EXIST "python" (
set PYTHON_EXECUTABLE=python3
) else (
set PYTHON_EXECUTABLE=python
)
)

"%PYTHON_EXECUTABLE%" install_requirements.py %*

exit /b %ERRORLEVEL%
6 changes: 6 additions & 0 deletions install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ def python_is_compatible():
print(f"Error: Unknown option {arg}")
sys.exit(1)

# Use ClangCL on Windows.
# ClangCL is an alias to Clang that configures it to work in an MSVC-compatible
# mode. Using it on Windows to avoid compiler compatibility issues for MSVC.
if os.name == "nt":
CMAKE_ARGS += " -T ClangCL"

# Since ExecuTorch often uses main-branch features of pytorch, only the nightly
# pip versions will have the required features.
#
Expand Down
Loading