diff --git a/.gitignore b/.gitignore index 362b3cd7a..a6219bf8a 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,4 @@ node_modules # Analytics cache folder cache/ .vscode/ +/.vs diff --git a/conda/pytorch-nightly/bld.bat b/conda/pytorch-nightly/bld.bat index 775256ea7..455037d19 100644 --- a/conda/pytorch-nightly/bld.bat +++ b/conda/pytorch-nightly/bld.bat @@ -39,10 +39,10 @@ echo libuv_ROOT=%libuv_ROOT% IF "%USE_SCCACHE%" == "1" ( mkdir %SRC_DIR%\tmp_bin - curl -k https://s3.amazonaws.com/ossci-windows/sccache.exe --output %SRC_DIR%\tmp_bin\sccache.exe - curl -k https://s3.amazonaws.com/ossci-windows/sccache-cl.exe --output %SRC_DIR%\tmp_bin\sccache-cl.exe + curl -k https://ossci-windows.s3.amazonaws.com/sccache-v0.7.4.exe --output %SRC_DIR%\tmp_bin\sccache.exe set "PATH=%SRC_DIR%\tmp_bin;%PATH%" set SCCACHE_IDLE_TIMEOUT=1500 + set SCCACHE_REGION=us-east-1 ) IF "%build_with_cuda%" == "" goto cuda_end @@ -82,8 +82,9 @@ sccache --stop-server sccache --start-server sccache --zero-stats -set CC=sccache-cl -set CXX=sccache-cl +set CMAKE_C_COMPILER_LAUNCHER=sccache +set CMAKE_CXX_COMPILER_LAUNCHER=sccache + :sccache_end diff --git a/windows/build_pytorch.bat b/windows/build_pytorch.bat index 750d3c5e3..c3380db22 100644 --- a/windows/build_pytorch.bat +++ b/windows/build_pytorch.bat @@ -87,11 +87,11 @@ if not "%CUDA_VERSION%" == "cpu" ( :: Install sccache if "%USE_SCCACHE%" == "1" ( mkdir %CD%\tmp_bin - curl -k https://s3.amazonaws.com/ossci-windows/sccache.exe --output %CD%\tmp_bin\sccache.exe - curl -k https://s3.amazonaws.com/ossci-windows/sccache-cl.exe --output %CD%\tmp_bin\sccache-cl.exe + curl -k https://ossci-windows.s3.amazonaws.com/sccache-v0.7.4.exe --output %CD%\tmp_bin\sccache.exe if not "%CUDA_VERSION%" == "" ( set ADDITIONAL_PATH=%CD%\tmp_bin set SCCACHE_IDLE_TIMEOUT=1500 + set SCCACHE_REGION=us-east-1 :: randomtemp is used to resolve the intermittent build error related to CUDA. :: code: https://github.com/peterjc123/randomtemp-rust diff --git a/windows/internal/check_opts.bat b/windows/internal/check_opts.bat index 5b8a67e25..0adeb6c5c 100755 --- a/windows/internal/check_opts.bat +++ b/windows/internal/check_opts.bat @@ -17,22 +17,12 @@ IF NOT ERRORLEVEL 1 ( set CXX=clcache ) -where /q sccache-cl.exe - -IF NOT ERRORLEVEL 1 ( - echo sccache-cl found, using it to speed up builds - set CC=sccache-cl - set CXX=sccache-cl -) - -IF "%CC%" == "sccache-cl" IF "%CXX%" == "sccache-cl" goto sccache_end - where /q sccache.exe IF NOT ERRORLEVEL 1 ( echo sccache found, using it to speed up builds - set CC=sccache cl - set CXX=sccache cl + set CMAKE_C_COMPILER_LAUNCHER=sccache + set CMAKE_CXX_COMPILER_LAUNCHER=sccache ) :sccache_end diff --git a/windows/internal/setup.bat b/windows/internal/setup.bat index 810d09db9..4f2509e55 100755 --- a/windows/internal/setup.bat +++ b/windows/internal/setup.bat @@ -22,8 +22,7 @@ IF NOT exist "setup.py" ( cd %MODULE_NAME% ) -if "%CXX%"=="sccache cl" goto sccache_start -if "%CXX%"=="sccache-cl" goto sccache_start +if "%CMAKE_CXX_COMPILER_LAUNCHER%"=="sccache" goto sccache_start goto sccache_end :sccache_start @@ -92,8 +91,7 @@ python setup.py bdist_wheel -d "%PYTORCH_FINAL_PACKAGE_DIR%" IF ERRORLEVEL 1 exit /b 1 IF NOT ERRORLEVEL 0 exit /b 1 -if "%CXX%"=="sccache cl" goto sccache_cleanup -if "%CXX%"=="sccache-cl" goto sccache_cleanup +if "%CMAKE_CXX_COMPILER_LAUNCHER%"=="sccache" goto sccache_cleanup goto sccache_cleanup_end :sccache_cleanup