未验证 提交 a9164245 编写于 作者: S Sing_chan 提交者: GitHub

make vcvars64 and cuda_version can be set in xly pipe (#40870)

* make vcvars64 and cuda_version can be set in xly pipe

* make third_party_path reused by ci and build pipe;test=windows_ci_inference;test=windows_op;test=windows_ci
上级 83906bcf
...@@ -251,6 +251,7 @@ set MSVC_STATIC_CRT=ON ...@@ -251,6 +251,7 @@ set MSVC_STATIC_CRT=ON
set ON_INFER=ON set ON_INFER=ON
set WITH_TENSORRT=ON set WITH_TENSORRT=ON
set WITH_INFERENCE_API_TEST=ON set WITH_INFERENCE_API_TEST=ON
set vcvars64_dir="D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
call :cmake || goto cmake_error call :cmake || goto cmake_error
call :build || goto build_error call :build || goto build_error
...@@ -314,11 +315,9 @@ echo ======================================== ...@@ -314,11 +315,9 @@ echo ========================================
rem set vs language to english to block showIncludes, this need vs has installed English language package. rem set vs language to english to block showIncludes, this need vs has installed English language package.
set VSLANG=1033 set VSLANG=1033
rem Configure the environment for 64-bit builds. 'DISTUTILS_USE_SDK' indicates that the user has selected the compiler. rem Configure the environment for 64-bit builds. 'DISTUTILS_USE_SDK' indicates that the user has selected the compiler.
echo %task_name%|findstr wincheck_inference >nul && ( if not defined vcvars64_dir set vcvars64_dir="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
call "D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" call %vcvars64_dir%
) || (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
)
set DISTUTILS_USE_SDK=1 set DISTUTILS_USE_SDK=1
rem Windows 10 Kit bin dir rem Windows 10 Kit bin dir
set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;%PATH% set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;%PATH%
...@@ -381,18 +380,8 @@ echo echo ${md5_content}^>md5.txt >> cache.sh ...@@ -381,18 +380,8 @@ echo echo ${md5_content}^>md5.txt >> cache.sh
%cache_dir%\tools\busybox64.exe bash cache.sh %cache_dir%\tools\busybox64.exe bash cache.sh
set /p md5=< md5.txt set /p md5=< md5.txt
echo %task_name%|findstr build >nul && (
set THIRD_PARTY_HOME=%cache_dir:\=/%/third_party
set THIRD_PARTY_PATH=!THIRD_PARTY_HOME!/%md5%
echo %task_name% is a whl-build task, will only reuse local third_party cache.
goto :cmake_impl
) || (
echo %task_name% is a PR-CI-Windows task, will try to reuse bos and local third_party cache both.
)
if "%WITH_GPU%"=="ON" ( if "%WITH_GPU%"=="ON" (
for /F %%# in ('dir /b /d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\"') do set cuda_version=%%# set cuda_version=%CUDA_TOOLKIT_ROOT_DIR:~-4%
set cuda_version=!cuda_version:~-4!
set sub_dir=cuda!cuda_version:.=! set sub_dir=cuda!cuda_version:.=!
) else ( ) else (
set sub_dir=cpu set sub_dir=cpu
...@@ -400,6 +389,13 @@ if "%WITH_GPU%"=="ON" ( ...@@ -400,6 +389,13 @@ if "%WITH_GPU%"=="ON" (
set THIRD_PARTY_HOME=%cache_dir:\=/%/third_party/%sub_dir% set THIRD_PARTY_HOME=%cache_dir:\=/%/third_party/%sub_dir%
set THIRD_PARTY_PATH=%THIRD_PARTY_HOME%/%md5% set THIRD_PARTY_PATH=%THIRD_PARTY_HOME%/%md5%
echo %task_name%|findstr build >nul && (
echo %task_name% is a whl-build task, will only reuse local third_party cache.
goto :cmake_impl
) || (
echo %task_name% is a PR-CI-Windows task, will try to reuse bos and local third_party cache both.
)
if not exist %THIRD_PARTY_PATH% ( if not exist %THIRD_PARTY_PATH% (
echo There is no usable third_party cache in %THIRD_PARTY_PATH%, will download from bos. echo There is no usable third_party cache in %THIRD_PARTY_PATH%, will download from bos.
pip install wget pip install wget
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册