@@ -18,19 +18,18 @@ rem Paddle CI Task On Windows Platform
18
18
rem =================================================
19
19
20
20
@ ECHO ON
21
- setlocal
21
+ setlocal enabledelayedexpansion
22
22
23
23
rem -------clean up environment-----------
24
24
set work_dir = %cd%
25
- set cache_dir = %work_dir:Paddle =cache %
25
+ if not defined cache_dir set cache_dir = %work_dir:Paddle =cache %
26
26
if not exist %cache_dir% \tools (
27
27
git clone https://github.com/zhouwei25/tools.git %cache_dir% \tools
28
28
)
29
- taskkill /f /im op_function_generator.exe 2 > NUL
30
29
taskkill /f /im cmake.exe 2 > NUL
31
30
taskkill /f /im MSBuild.exe 2 > NUL
32
- taskkill /f /im CL .exe 2 > NUL
33
- taskkill /f /im Lib .exe 2 > NUL
31
+ taskkill /f /im cl .exe 2 > NUL
32
+ taskkill /f /im lib .exe 2 > NUL
34
33
taskkill /f /im link.exe 2 > NUL
35
34
taskkill /f /im vctip.exe 2 > NUL
36
35
taskkill /f /im cvtres.exe 2 > NUL
@@ -41,14 +40,12 @@ taskkill /f /im python.exe 2>NUL
41
40
taskkill /f /im nvcc.exe 2 > NUL
42
41
taskkill /f /im cicc.exe 2 > NUL
43
42
taskkill /f /im ptxas.exe 2 > NUL
44
- taskkill /f /im test_api_impl.exe 2 > NUL
45
43
taskkill /f /im op_function_generator.exe 2 > NUL
46
44
wmic process where name=" op_function_generator.exe" call terminate 2 > NUL
47
- wmic process where name=" test_api_impl.exe" call terminate 2 > NUL
48
45
wmic process where name=" cvtres.exe" call terminate 2 > NUL
49
46
wmic process where name=" rc.exe" call terminate 2 > NUL
50
- wmic process where name=" CL .exe" call terminate 2 > NUL
51
- wmic process where name=" Lib .exe" call terminate 2 > NUL
47
+ wmic process where name=" cl .exe" call terminate 2 > NUL
48
+ wmic process where name=" lib .exe" call terminate 2 > NUL
52
49
wmic process where name=" python.exe" call terminate 2 > NUL
53
50
54
51
rem ------initialize common variable------
@@ -66,7 +63,7 @@ if not defined WITH_PYTHON set WITH_PYTHON=ON
66
63
if not defined ON_INFER set ON_INFER = ON
67
64
if not defined WITH_INFERENCE_API_TEST set WITH_INFERENCE_API_TEST = ON
68
65
if not defined WITH_STATIC_LIB set WITH_STATIC_LIB = ON
69
- if not defined WITH_TPCACHE set WITH_TPCACHE = ON
66
+ if not defined WITH_TPCACHE set WITH_TPCACHE = OFF
70
67
if not defined WITH_CLCACHE set WITH_CLCACHE = OFF
71
68
if not defined WITH_CACHE set WITH_CACHE = OFF
72
69
if not defined WITH_UNITY_BUILD set WITH_UNITY_BUILD = OFF
@@ -79,6 +76,7 @@ if not defined PYTHON_ROOT set PYTHON_ROOT=C:\Python37
79
76
80
77
rem -------set cache build directory-----------
81
78
rmdir build\python /s/q
79
+ rem rmdir build\paddle\fluid\pybind /s/q
82
80
rmdir build\paddle_install_dir /s/q
83
81
rmdir build\paddle_inference_install_dir /s/q
84
82
rmdir build\paddle_inference_c_install_dir /s/q
@@ -137,10 +135,11 @@ goto :CASE_%1
137
135
138
136
echo " Usage: paddle_build.bat [OPTION]"
139
137
echo " OPTION:"
140
- echo " wincheck_mkl: run Windows MKL/GPU/UnitTest CI tasks on Windows"
141
- echo " wincheck_openbals: run Windows OPENBLAS/CPU CI tasks on Windows"
138
+ echo " wincheck_mkl: run Windows MKL/GPU PR CI tasks on Windows"
139
+ echo " wincheck_openbals: run Windows OPENBLAS/CPU PR CI tasks on Windows"
142
140
echo " build_avx_whl: build Windows avx whl package on Windows"
143
141
echo " build_no_avx_whl: build Windows no avx whl package on Windows"
142
+ echo " build_inference_lib: build Windows inference library on Windows"
144
143
exit /b 1
145
144
146
145
rem ------PR CI windows check for MKL/GPU----------
@@ -200,6 +199,7 @@ goto:success
200
199
201
200
rem ------Build windows inference library------
202
201
:CASE_build_inference_lib
202
+ set ON_INFER = ON
203
203
set WITH_PYTHON = OFF
204
204
set CUDA_ARCH_NAME = All
205
205
@@ -226,6 +226,8 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary
226
226
set DISTUTILS_USE_SDK = 1
227
227
rem Windows 10 Kit bin dir
228
228
set PATH = C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;%PATH%
229
+ rem Use 64-bit ToolSet to compile
230
+ set PreferredToolArchitecture = x64
229
231
230
232
for /F %% # in ('wmic os get localdatetime^ |findstr 20') do set start = %% #
231
233
set start = %start:~4 ,10 %
@@ -250,14 +252,15 @@ if "%WITH_GPU%"=="ON" (
250
252
)
251
253
252
254
rem ------initialize the python environment------
255
+ @ ECHO ON
253
256
set PYTHON_EXECUTABLE = %PYTHON_ROOT% \python.exe
254
257
set PATH = %PYTHON_ROOT% ;%PYTHON_ROOT% \Scripts;%PATH%
255
- if %WITH_PYTHON% == " OFF " (
258
+ if " %WITH_PYTHON% " == " ON " (
256
259
where python
257
260
where pip
258
261
pip install wheel --user
259
262
pip install -r %work_dir% \python\requirements.txt --user
260
- if % ERRORLEVEL% NEQ 0 (
263
+ if ! ERRORLEVEL! NEQ 0 (
261
264
echo pip install requirements.txt failed!
262
265
exit /b 7
263
266
)
@@ -318,7 +321,7 @@ if "%WITH_GPU%"=="ON" (
318
321
)
319
322
320
323
:cmake_impl
321
- echo cmake .. -G %GENERATOR% -T host=x64 -DCMAKE_BUILD_TYPE=Release -DWITH_AVX=%WITH_AVX% -DWITH_GPU=%WITH_GPU% -DWITH_MKL=%WITH_MKL% ^
324
+ echo cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=Release - T host=x64 -DWITH_AVX=%WITH_AVX% -DWITH_GPU=%WITH_GPU% -DWITH_MKL=%WITH_MKL% ^
322
325
-DWITH_TESTING=%WITH_TESTING% -DWITH_PYTHON=%WITH_PYTHON% -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% -DON_INFER=%ON_INFER% ^
323
326
-DWITH_INFERENCE_API_TEST=%WITH_INFERENCE_API_TEST% -DTHIRD_PARTY_PATH=%THIRD_PARTY_PATH% ^
324
327
-DINFERENCE_DEMO_INSTALL_DIR=%INFERENCE_DEMO_INSTALL_DIR% -DWITH_STATIC_LIB=%WITH_STATIC_LIB% ^
@@ -374,6 +377,7 @@ set build_times=1
374
377
rem clcache.exe -z
375
378
376
379
rem -------clean up environment again-----------
380
+ taskkill /f /im cmake.exe 2 > NUL
377
381
taskkill /f /im MSBuild.exe 2 > NUL
378
382
taskkill /f /im cl.exe 2 > NUL
379
383
taskkill /f /im lib.exe 2 > NUL
@@ -386,18 +390,20 @@ taskkill /f /im csc.exe 2>NUL
386
390
taskkill /f /im nvcc.exe 2 > NUL
387
391
taskkill /f /im cicc.exe 2 > NUL
388
392
taskkill /f /im ptxas.exe 2 > NUL
389
- taskkill /f /im test_api_impl.exe 2 > NUL
390
393
taskkill /f /im op_function_generator.exe 2 > NUL
391
394
wmic process where name=" op_function_generator.exe" call terminate 2 > NUL
392
- wmic process where name=" test_api_impl.exe" call terminate 2 > NUL
393
395
wmic process where name=" cvtres.exe" call terminate 2 > NUL
394
396
wmic process where name=" rc.exe" call terminate 2 > NUL
395
- wmic process where name=" CL.exe" call terminate 2 > NUL
396
- wmic process where name=" Lib.exe" call terminate 2 > NUL
397
+ wmic process where name=" cl.exe" call terminate 2 > NUL
398
+ wmic process where name=" lib.exe" call terminate 2 > NUL
399
+
400
+ if " %WITH_TESTING% " == " ON" (
401
+ for /F " tokens=1 delims= " %% # in ('tasklist ^ | findstr /i test') do taskkill /f /im %% #
402
+ )
397
403
398
404
echo Build Paddle the %build_times% time:
399
405
if %GENERATOR% == " Ninja" (
400
- ninja -j %PARALLEL_PROJECT_COUNT%
406
+ ninja all
401
407
) else (
402
408
if " %WITH_CLCACHE% " == " OFF" (
403
409
MSBuild /m:%PARALLEL_PROJECT_COUNT% /p:PreferredToolArchitecture=x64 /p:TrackFileAccess=false /p:Configuration=Release /verbosity:%LOG_LEVEL% ALL_BUILD.vcxproj
@@ -489,7 +495,6 @@ echo ========================================
489
495
echo Step 4. Running unit tests ...
490
496
echo ========================================
491
497
492
-
493
498
: set CI_SKIP_CPP_TEST if only *.py changed
494
499
git diff --name-only %BRANCH% | findstr /V " \.py" || set CI_SKIP_CPP_TEST = ON
495
500
@@ -778,15 +783,16 @@ taskkill /f /im python.exe 2>NUL
778
783
taskkill /f /im nvcc.exe 2 > NUL
779
784
taskkill /f /im cicc.exe 2 > NUL
780
785
taskkill /f /im ptxas.exe 2 > NUL
781
- taskkill /f /im test_api_impl.exe 2 > NUL
782
786
taskkill /f /im op_function_generator.exe 2 > NUL
783
787
wmic process where name=" op_function_generator.exe" call terminate 2 > NUL
784
- wmic process where name=" test_api_impl.exe" call terminate 2 > NUL
785
788
wmic process where name=" cvtres.exe" call terminate 2 > NUL
786
789
wmic process where name=" rc.exe" call terminate 2 > NUL
787
- wmic process where name=" CL .exe" call terminate 2 > NUL
788
- wmic process where name=" Lib .exe" call terminate 2 > NUL
790
+ wmic process where name=" cl .exe" call terminate 2 > NUL
791
+ wmic process where name=" lib .exe" call terminate 2 > NUL
789
792
wmic process where name=" python.exe" call terminate 2 > NUL
793
+ if " %WITH_TESTING% " == " ON" (
794
+ for /F " tokens=1 delims= " %% # in ('tasklist ^ | findstr /i test') do taskkill /f /im %% #
795
+ )
790
796
echo Windows CI run successfully!
791
797
exit /b 0
792
798
0 commit comments