Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c196d9aa
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c196d9aa
编写于
9月 01, 2023
作者:
X
xuxinyi389
提交者:
GitHub
9月 01, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
One click configuration of CI environment (#56817)
* One click configuration of CI environment * fix bugs
上级
394bb8c2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
145 addition
and
42 deletion
+145
-42
tools/windows/build_compile_environment.bat
tools/windows/build_compile_environment.bat
+145
-42
未找到文件。
tools/windows/build_compile_environment.bat
浏览文件 @
c196d9aa
...
...
@@ -20,29 +20,36 @@
:: Install compile environment for xly CI.
::
:: Include:
:: 1. CMake 3.1
7
.0
:: 1. CMake 3.1
8
.0
:: 2. Git 2.28.0
:: 3. Python 3.8.3
:: 3. Python 3.8.3
\3.9.7\3.10.0
:: 4. Visual Studio 2017 Community
:: 5. CUDA 11.2
:: 6. java jre
:: 7. sccache
:: 8. xly agent
:: 8. TensorRT
:: 9. xly agent
:: Echo command is not required.
@echo
off
cd
/d
%~dp0
%
SET
INSTALL_FLAG
=
%
1
:: 0. PR_CI_Windows_OPENBLAS
:: 1. PR_CI_Windows_Inference,will install VS2019, CUDA11.2
:: 2. PR_CI_Windows,CUDA10.2
:: ===== start step 0: wget tool =====
:: Download wget for windows when there is not wget tool.
echo
">>>>>>>> step [0/
8
]: wget tool"
echo
">>>>>>>> step [0/
9
]: wget tool"
wget
--help
>
nul
2
>
nul
||
call
:install
_wget
goto
cmake
:install
_wget
echo
There
is
not
wget
in
this
PC
,
will
download
wget
1
.2
0
.
echo
Download
package
from
https
://eternallybored.org/misc/wget/1.2
0
/64/wget.exe ...
certutil
-urlcache -split -f
https
://eternallybored.org/misc/wget/1.2
0
/64/wget.exe
>
nul
2
>
nul
echo
There
is
not
wget
in
this
PC
,
will
download
wget
1
.2
1.4
.
echo
Download
package
from
https
://eternallybored.org/misc/wget/1.2
1.4
/64/wget.exe ...
certutil
-urlcache -split -f
https
://eternallybored.org/misc/wget/1.2
1.4
/64/wget.exe
>
nul
2
>
nul
if
%errorlevel%
==
0
(
echo
Download
wget
tool
into
%cd%
success
.
)
else
(
...
...
@@ -53,26 +60,26 @@ goto :eof
:: ===== end step 0: wget tool =====
:: ===== start step 1: cmake =====
:: Download CMake-3.1
7
.0 and add in PATH when it not installed.
:: TODO: limit version >= 3.1
7
.0
:: Download CMake-3.1
8
.0 and add in PATH when it not installed.
:: TODO: limit version >= 3.1
8
.0
:cmake
echo
">>>>>>>> step [1/
8]: CMake 3.17
.0"
echo
">>>>>>>> step [1/
9]: CMake 3.18
.0"
cmake
--help
>
nul
2
>
nul
||
call
:install
_cmake
goto
git
:install
_cmake
echo
There
is
not
cmake
in
this
PC
,
will
install
cmake
-
3
.1
7
.0.
echo
Download
package
from
https
://cmake.org/files/v3.1
7/cmake
-
3
.17
.0
-win
64
-x
64
.msi ...
wget
-O
cmake
-
3
.1
7.0
-win
64
-x
64
.msi
https
://cmake.org/files/v3.17/cmake
-
3
.17
.0
-win
64
-x
64
.msi
echo
Install
cmake
-
3
.1
7
.0 ...
echo
There
is
not
cmake
in
this
PC
,
will
install
cmake
-
3
.1
8
.0.
echo
Download
package
from
https
://cmake.org/files/v3.1
8/cmake
-
3
.18
.0
-win
64
-x
64
.msi ...
wget
-O
cmake
-
3
.1
8.0
-win
64
-x
64
.msi
https
://cmake.org/files/v3.18/cmake
-
3
.18
.0
-win
64
-x
64
.msi
echo
Install
cmake
-
3
.1
8
.0 ...
:: /passive [silent installation]
:: /norestart [do not restart]
:: ADD_CMAKE_TO_PATH = System [add CMake to the system PATH for all users]
start
/wait
cmake
-
3
.1
7
.0
-win
64
-x
64
.msi
/passive /norestart
ADD_CMAKE_TO_PATH
=
System
start
/wait
cmake
-
3
.1
8
.0
-win
64
-x
64
.msi
/passive /norestart
ADD_CMAKE_TO_PATH
=
System
if
%errorlevel%
==
0
(
echo
Install
CMake
-
3
.1
7
.0
success
!
echo
Install
CMake
-
3
.1
8
.0
success
!
)
else
(
echo
Error
*****
Install
Cmake
-
3
.1
7
.0
failed
,
please
re
-install
it
manually
.
echo
Error
*****
Install
Cmake
-
3
.1
8
.0
failed
,
please
re
-install
it
manually
.
)
goto
:eof
:: ===== end step 1: cmake =====
...
...
@@ -81,7 +88,7 @@ goto :eof
:: Download Git-2.28.0 and add in PATH when it not installed.
:: TODO: limit version >= 2.28.0
:git
echo
">>>>>>>> step [2/
8
]: Git 2.28.0"
echo
">>>>>>>> step [2/
9
]: Git 2.28.0"
git
--help
>
nul
2
>
nul
||
call
:install
_git
goto
python
...
...
@@ -103,17 +110,19 @@ goto :eof
:: ===== end step 2: Git =====
:: ===== start step 3: Python =====
:: Download Python
-3.8.3
and add in PATH when it not installed.
:: Download Python and add in PATH when it not installed.
:: TODO: limit version >= 3.8.3
:python
echo
">>>>>>>> step [3/8]: Python 3.8.3"
python
-V
2
>&
1
|
findstr
/C
:
"Python 3.8.3"
>
nul
2
>
nul
||
call
:install
_python
echo
">>>>>>>> step [3/9]: Python"
where
python
2
>&
1
|
findstr
/C
:
"Python38"
>
nul
2
>
nul
||
call
:install
_python3.8.3
where
python
2
>&
1
|
findstr
/C
:
"Python39"
>
nul
2
>
nul
||
call
:install
_python3.9.7
where
python
2
>&
1
|
findstr
/C
:
"Python310"
>
nul
2
>
nul
||
call
:install
_python3.10.0
goto
vs
:install
_python
:install
_python
3.8.3
echo
There
is
not
Python
in
this
PC
,
will
install
Python
-
3
.8.3
echo
Download
package
from
https
://
paddle
-ci
.gz.bcebos.com/window_requirement
/python
-
3
.8.3
-amd
64
.exe ...
wget
-O
python
-
3
.8.3
-amd
64
.exe
https
://
paddle
-ci
.gz.bcebos.com/window_requirement
/python
-
3
.8.3
-amd
64
.exe
echo
Download
package
from
https
://
www.python.org/ftp/python/3.8.3
/python
-
3
.8.3
-amd
64
.exe ...
wget
-O
python
-
3
.8.3
-amd
64
.exe
https
://
www.python.org/ftp/python/3.8.3
/python
-
3
.8.3
-amd
64
.exe
echo
Install
Python
-
3
.8.3 ...
:: /passive [silent install]
:: InstallAllUsers [add path for all users]
...
...
@@ -126,16 +135,46 @@ if %errorlevel% == 0 (
echo
Error
*****
Install
python
-
3
.8.3
failed
,
please
re
-install
it
manually
.
)
goto
:eof
:install
_python3.9.7
echo
There
is
not
Python
in
this
PC
,
will
install
Python
-
3
.9.7
echo
Download
package
from
https
://www.python.org/ftp/python/3.9.7/python
-
3
.9.7
-amd
64
.exe ...
wget
-O
python
-
3
.9.7
-amd
64
.exe
https
://www.python.org/ftp/python/3.9.7/python
-
3
.9.7
-amd
64
.exe
echo
Install
Python
-
3
.9.7 ...
start
/wait
python
-
3
.9.7
-amd
64
.exe
/passive
InstallAllUsers
=
1
PrependPath
=
1
TargetDir
=
C
:\Python39
if
%errorlevel%
==
0
(
echo
Install
python
-
3
.9.7
success
!
)
else
(
echo
Error
*****
Install
python
-
3
.9.7
failed
,
please
re
-install
it
manually
.
)
goto
:eof
:install
_python3.10.0
echo
There
is
not
Python
in
this
PC
,
will
install
Python
-
3
.10.0
echo
Download
package
from
https
://www.python.org/ftp/python/3.10.0/python
-
3
.10.0
-amd
64
.exe ...
wget
-O
python
-
3
.10.0
-amd
64
.exe
https
://www.python.org/ftp/python/3.10.0/python
-
3
.10.0
-amd
64
.exe
echo
Install
Python
-
3
.10.0 ...
start
/wait
python
-
3
.10.0
-amd
64
.exe
/passive
InstallAllUsers
=
1
PrependPath
=
1
TargetDir
=
C
:\Python310
if
%errorlevel%
==
0
(
echo
Install
python
-
3
.10.0
success
!
)
else
(
echo
Error
*****
Install
python
-
3
.10.0
failed
,
please
re
-install
it
manually
.
)
goto
:eof
:: ===== end step 3: Python =====
:: ===== start step 4: Visual Studio
2017
Community =====
:: ===== start step 4: Visual Studio Community =====
:: Download Visual Studio 2017 when it not installed.
:vs
echo
">>>>>>>> step [4/8]: Visual Studio 2017 "
cmd
/C
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
>
nul
2
>
nul
||
call
:install
_visual_studio
echo
">>>>>>>> step [4/9]: Visual Studio"
if
%INSTALL_FLAG%
==
1
(
cmd
/C
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
>
nul
2
>
nul
||
call
:install
_visual_studio2019
)
else
(
cmd
/C
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
>
nul
2
>
nul
||
call
:install
_visual_studio2017
)
goto
:cuda
:install
_visual_studio
:install
_visual_studio
2017
echo
There
is
not
Visual
Studio
in
this
PC
,
will
install
VS2017
.
echo
Download
package
from
"https://paddle-ci.gz.bcebos.com/window_requirement/VS2017/vs_Community.exe"
wget
-O
vs_Community
.exe
"https://paddle-ci.gz.bcebos.com/window_requirement/VS2017/vs_Community.exe"
...
...
@@ -151,15 +190,57 @@ if %errorlevel% == 0 (
echo
Error
*****
Install
Visual
Studio
2017
failed
,
please
re
-install
it
manually
.
)
goto
:eof
:: ===== end step 4: Visual Studio 2017 =====
:: ===== start step 5: CUDA 11 =====
:install
_visual_studio2019
echo
There
is
not
Visual
Studio
in
this
PC
,
will
install
VS2019
.
echo
Download
package
from
"https://paddle-ci.gz.bcebos.com/window_requirement/vs_community_2019.exe"
wget
-O
vs_community_2019
.exe
"https://paddle-ci.gz.bcebos.com/window_requirement/vs_community_2019.exe"
echo
Install
Visual
Studio
2019
...
start
/wait
vs_community_2019
.exe
--passive --add
Microsoft
.VisualStudio.Workload.NativeDesktop
--add
Microsoft
.VisualStudio.Workload.Universal
--includeRecommended
if
%errorlevel%
==
0
(
echo
Install
Visual
Studio
2019
success
!
)
else
(
echo
Error
*****
Install
Visual
Studio
2019
failed
,
please
re
-install
it
manually
.
)
goto
:eof
:: ===== end step 4: Visual Studio Community =====
:: ===== start step 5: CUDA =====
:cuda
echo
">>>>>>>> step [5/8]: CUDA 11.2"
cmd
/C
nvcc
--version
2
>
nul
|
findstr
/C
:
"11.2"
>
nul
2
>
nul
||
call
:install
_cuda
echo
">>>>>>>> step [5/9]: CUDA "
if
%INSTALL_FLAG%
==
1
(
cmd
/C
nvcc
--version
2
>
nul
|
findstr
/C
:
"11.2"
>
nul
2
>
nul
||
call
:install
_cuda112
)
if
%INSTALL_FLAG%
==
2
(
cmd
/C
nvcc
--version
2
>
nul
|
findstr
/C
:
"10.2"
>
nul
2
>
nul
||
call
:install
_cuda102
)
goto
java
-jre
:install
_cuda
:install
_cuda102
echo
There
is
not
CUDA
in
this
PC
,
will
install
CUDA
-
10
.2.
echo
Download
package
from
"https://paddle-ci.gz.bcebos.com/window_requirement/cuda_10.2.89_441.22_win10.exe"
wget
-O
cuda_installer
.exe
"https://paddle-ci.gz.bcebos.com/window_requirement/cuda_10.2.89_441.22_win10.exe"
echo
Install
CUDA
-
10
.2 ...
:: -s [silent install]
start
/wait
cuda_installer
.exe
-s
if
%errorlevel%
==
0
(
echo
Install
CUDA
-
10
.2
success
!
)
else
(
echo
Error
*****
Install
CUDA
-
10
.2
failed
,
please
re
-install
it
manually
.
goto
:eof
)
del
cuda_installer
.exe
echo
Download
cudnn
from
"https://paddle-ci.gz.bcebos.com/window_requirement/cudnn-10.2-windows10-x64-v7.6.5.32.zip"
wget
-O
cudnn
-
10
.2
-windows
10
-x
64
-v
7
.6.5.32.zip
"https://paddle-ci.gz.bcebos.com/window_requirement/cudnn-10.2-windows10-x64-v7.6.5.32.zip"
tar
xf
cudnn
-
10
.2
-windows
10
-x
64
-v
7
.6.5.32.zip
xcopy
/E /Y /R
"cuda\bin\*"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin"
xcopy
/E /Y /R
"cuda\include\*"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include"
xcopy
/E /Y /R
"cuda\lib\*"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib"
rd
/s /q
cuda
goto
:eof
:install
_cuda112
echo
There
is
not
CUDA
in
this
PC
,
will
install
CUDA
-
11
.2.
echo
Download
package
from
"https://paddle-ci.gz.bcebos.com/window_requirement/cuda_11.2.0_460.89_win10.exe"
wget
-O
cuda_installer
.exe
"https://paddle-ci.gz.bcebos.com/window_requirement/cuda_11.2.0_460.89_win10.exe"
...
...
@@ -173,7 +254,6 @@ if %errorlevel% == 0 (
goto
:eof
)
del
cuda_installer
.exe
echo
Download
cudnn
from
"https://paddle-ci.gz.bcebos.com/window_requirement/cudnn-11.2-windows-x64-v8.1.0.77.zip"
wget
-O
cudnn
-
11
.2
-windows-x
64
-v
8
.1.0.77.zip
"https://paddle-ci.gz.bcebos.com/window_requirement/cudnn-11.2-windows-x64-v8.1.0.77.zip"
tar
xf
cudnn
-
11
.2
-windows-x
64
-v
8
.1.0.77.zip
...
...
@@ -182,11 +262,11 @@ xcopy /E /Y /R "cuda\include\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\C
xcopy
/E /Y /R
"cuda\lib\*"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\lib"
rd
/s /q
cuda
goto
:eof
:: ===== end step 5: CUDA
10
=====
:: ===== end step 5: CUDA =====
:: ===== start step 6: java jre =====
:java
-jre
echo
">>>>>>>> step [6/
8
]: java jre"
echo
">>>>>>>> step [6/
9
]: java jre"
cmd
/C
java
-version
>
nul
2
>
nul
||
call
:install
_java
goto
sccache
...
...
@@ -208,21 +288,44 @@ goto :eof
:: ===== start step 7: sccache on windowss =====
:sccache
echo
">>>>>>>> step [7/
8
]: sccache"
echo
">>>>>>>> step [7/
9
]: sccache"
cmd
/C
sccache
-V
>
nul
2
>
nul
||
call
:download
_sccache
goto
xly
-agen
t
goto
tensorr
t
:download
_sccache
echo
There
is
not
sccache
in
this
PC
,
will
install
sccache
.
echo
Download
package
from
https
://paddle
-ci
.gz.bcebos.com/window_requirement/sccache.exe
wget
-O
sccache
.exe
"https://paddle-ci.gz.bcebos.com/window_requirement/sccache.exe"
copy
sccache
.exe
C
:\Python38
/Y
goto
:eof
:: ===== end step 7: sccache on windows =====
:: ===== start step 8: xly agent =====
:: ===== start step 8: TensorRT =====
:tensorrt
echo
">>>>>>>> step [8/9]: TensorRT"
if
%INSTALL_FLAG%
==
2
(
call
:download
_TensorRT_7_0_0_11
)
if
%INSTALL_FLAG%
==
1
(
call
:download
_TensorRT_8_0_1_6
)
goto
xly
-agent
:download
_TensorRT_7_0_0_11
if
not
exist
TensorRT
-
7
.0.0.11.Windows10.x86_64.cuda
-
10
.2.cudnn7.6.zip
wget
-O
TensorRT
-
7
.0.0.11.Windows10.x86_64.cuda
-
10
.2.cudnn7.6.zip
^
"https://paddle-ci.gz.bcebos.com/window_requirement/TensorRT-7.0.0.11.Windows10.x86_64.cuda-10.2.cudnn7.6.zip"
goto
:eof
:download
_TensorRT_8_0_1_6
if
not
exist
TTensorRT
-
8
.0.1.6.Windows10.x86_64.cuda
-
11
.3.cudnn8.2.zip
wget
-O
TensorRT
-
8
.0.1.6.Windows10.x86_64.cuda
-
11
.3.cudnn8.2.zip
^
"https://paddle-ci.gz.bcebos.com/window_requirement/TensorRT-8.0.1.6.Windows10.x86_64.cuda-11.3.cudnn8.2.zip"
goto
:eof
:: ===== end step 8: TensorRT =====
:: ===== start step 9: xly agent =====
:xly
-agent
echo
">>>>>>>> step [
8/8
]: xly agent"
wget
-O
agent
.jar
"https://xly.bce.baidu.com/sa_server/agent/v1/download?version=1.2.8"
:: ===== end step
8
: xly agent =====
echo
">>>>>>>> step [
9/9
]: xly agent"
if
not
exist
agent
.jar
wget
-O
agent
.jar
"https://xly.bce.baidu.com/sa_server/agent/v1/download?version=1.2.8"
:: ===== end step
9
: xly agent =====
pause
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录