未验证 提交 06c2d0c3 编写于 作者: P Peihan 提交者: GitHub

[cherry-pick] tar CAPI lib in paddle build scripts (#33563)

* add win_capi_tar in paddle_build.bat

* tar capi lib for publish

* add in gen_fluid_lib func
上级 a4e841e0
......@@ -205,7 +205,8 @@ set CUDA_ARCH_NAME=All
call :cmake || goto cmake_error
call :build || goto build_error
call :zip_file || goto zip_file_error
call :zip_cc_file || goto zip_cc_file_error
call :zip_c_file || goto zip_c_file_error
goto:success
rem "Other configurations are added here"
......@@ -671,7 +672,7 @@ goto:eof
exit /b 1
rem ---------------------------------------------------------------------------------------------
:zip_file
:zip_cc_file
tree /F %cd%\paddle_inference_install_dir\paddle
if exist paddle_inference.zip del paddle_inference.zip
python -c "import shutil;shutil.make_archive('paddle_inference', 'zip', root_dir='paddle_inference_install_dir')"
......@@ -683,10 +684,27 @@ for /F %%i in ("%libsize%") do (
)
goto:eof
:zip_file_error
:zip_cc_file_error
echo Tar inference library failed!
exit /b 1
rem ---------------------------------------------------------------------------------------------
:zip_c_file
tree /F %cd%\paddle_inference_c_install_dir\paddle
if exist paddle_inference_c.zip del paddle_inference_c.zip
python -c "import shutil;shutil.make_archive('paddle_inference_c', 'zip', root_dir='paddle_inference_c_install_dir')"
%cache_dir%\tools\busybox64.exe du -h -k paddle_inference_c.zip > lib_size.txt
set /p libsize=< lib_size.txt
for /F %%i in ("%libsize%") do (
set /a libsize_m=%%i/1024
echo "Windows Paddle_Inference CAPI ZIP Size: !libsize_m!M"
)
goto:eof
:zip_c_file_error
echo Tar inference capi library failed!
exit /b 1
:timestamp
setlocal enabledelayedexpansion
@ECHO OFF
......
......@@ -420,6 +420,13 @@ EOF
buildSize=$(du -h --max-depth=0 ${PADDLE_ROOT}/build/paddle_inference.tgz |awk '{print $1}')
echo "Paddle_Inference Size: $buildSize"
echo "ipipe_log_param_Paddle_Inference_Size: $buildSize" >> ${PADDLE_ROOT}/build/build_summary.txt
elif [ "$1" == "paddle_inference_c" ]; then
cd ${PADDLE_ROOT}/build
cp -r paddle_inference_c_install_dir paddle_inference_c
tar -czf paddle_inference_c.tgz paddle_inference_c
buildSize=$(du -h --max-depth=0 ${PADDLE_ROOT}/build/paddle_inference_c.tgz |awk '{print $1}')
echo "Paddle_Inference Capi Size: $buildSize"
echo "ipipe_log_param_Paddle_Inference_capi_Size: $buildSize" >> ${PADDLE_ROOT}/build/build_summary.txt
else
SYSTEM=`uname -s`
if [ "$SYSTEM" == "Darwin" ]; then
......@@ -1765,6 +1772,7 @@ EOF
echo "ipipe_log_param_Build_Time: $[ $endTime_s - $startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt
build_size "paddle_inference"
build_size "paddle_inference_c"
}
function tar_fluid_lib() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册