Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Merged
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
18 changes: 1 addition & 17 deletions windows/internal/vc_install_helper.bat
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
set VC_VERSION=
if "%VC_YEAR%" == "2017" if "%CUDA_VERSION%" == "92" (
set VC_VERSION=14.13
if not "%PYTORCH_BUILD_VERSION:1.6.=%" == "%PYTORCH_BUILD_VERSION%" if "%PYTORCH_BUILD_VERSION:dev=%" == "%PYTORCH_BUILD_VERSION%" (
set VC_VERSION=14.11
)
)
if "%VC_YEAR%" == "2019" set VC_VERSION=14.28.29333
if not "%VC_VERSION%" == "" (
set VSDEVCMD_ARGS=-vcvars_ver=%VC_VERSION%
)
if "%VC_YEAR%" == "2017" powershell windows/internal/vs2017_install.ps1 %VC_VERSION%
if "%VC_YEAR%" == "2019" powershell windows/internal/vs2019_install.ps1 %VC_VERSION%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I don't find where is using vc_version for VS2019 now.
  2. Do we still need VS 2017?

at first, I only wanted to change
if "%VC_YEAR%" == "2019" powershell windows/internal/vs2019_install.ps1 %VC_VERSION%
to
if "%VC_YEAR%" == "2019" powershell windows/internal/vs2019_install.ps1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is that it's very easy to scrape the lastest VS version but I don't find a way to scrape the matched vc toolchain version in web.

Copy link
Contributor

@peterjc123 peterjc123 Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean if you delete this line, then vs2019_install.ps1 is not executed, is this the correct behaviour? Sorry, looks like I made a mistake here. git diff shows a slightly different result from I would expect. And, you are right.

if "%VC_YEAR%" == "2019" powershell windows/internal/vs2019_install.ps1

set VC_VERSION_LOWER=16
set VC_VERSION_UPPER=17
IF "%VC_YEAR%" == "2017" (
set VC_VERSION_LOWER=15
set VC_VERSION_UPPER=16
)

for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do (
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" (
Expand Down