未验证 提交 00279fdc 编写于 作者: W wopeizl 提交者: GitHub

modify the build script for new ci test=develop (#16732)

上级 fdb719a1
...@@ -291,8 +291,12 @@ function build() { ...@@ -291,8 +291,12 @@ function build() {
Building in /paddle/build ... Building in /paddle/build ...
============================================ ============================================
EOF EOF
parallel_number=`nproc`
if [[ "$1" != "" ]]; then
parallel_number=$1
fi
make clean make clean
make -j `nproc` make -j ${parallel_number}
make install -j `nproc` make install -j `nproc`
} }
...@@ -737,9 +741,13 @@ function gen_fluid_lib() { ...@@ -737,9 +741,13 @@ function gen_fluid_lib() {
Generating fluid library for train and inference ... Generating fluid library for train and inference ...
======================================== ========================================
EOF EOF
parallel_number=`nproc`
if [[ "$1" != "" ]]; then
parallel_number=$1
fi
cmake .. -DWITH_DISTRIBUTE=OFF -DON_INFER=ON cmake .. -DWITH_DISTRIBUTE=OFF -DON_INFER=ON
make -j `nproc` fluid_lib_dist make -j ${parallel_number} fluid_lib_dist
make -j `nproc` inference_lib_dist make -j ${parallel_number} inference_lib_dist
} }
function tar_fluid_lib() { function tar_fluid_lib() {
...@@ -770,11 +778,22 @@ EOF ...@@ -770,11 +778,22 @@ EOF
function main() { function main() {
local CMD=$1 local CMD=$1
local parallel_number=$2
init init
case $CMD in case $CMD in
build_only)
cmake_gen ${PYTHON_ABI:-""}
build ${parallel_number}
;;
build_and_check)
cmake_gen ${PYTHON_ABI:-""}
build ${parallel_number}
assert_api_not_changed ${PYTHON_ABI:-""}
assert_api_spec_approvals
;;
build) build)
cmake_gen ${PYTHON_ABI:-""} cmake_gen ${PYTHON_ABI:-""}
build build ${parallel_number}
gen_dockerfile ${PYTHON_ABI:-""} gen_dockerfile ${PYTHON_ABI:-""}
;; ;;
test) test)
...@@ -797,7 +816,7 @@ function main() { ...@@ -797,7 +816,7 @@ function main() {
;; ;;
fluid_inference_lib) fluid_inference_lib)
cmake_gen ${PYTHON_ABI:-""} cmake_gen ${PYTHON_ABI:-""}
gen_fluid_lib gen_fluid_lib ${parallel_number}
tar_fluid_lib tar_fluid_lib
test_fluid_lib test_fluid_lib
;; ;;
...@@ -806,16 +825,16 @@ function main() { ...@@ -806,16 +825,16 @@ function main() {
;; ;;
cicheck) cicheck)
cmake_gen ${PYTHON_ABI:-""} cmake_gen ${PYTHON_ABI:-""}
build build ${parallel_number}
assert_api_not_changed ${PYTHON_ABI:-""} assert_api_not_changed ${PYTHON_ABI:-""}
run_test run_test
gen_fluid_lib gen_fluid_lib ${parallel_number}
test_fluid_lib test_fluid_lib
assert_api_spec_approvals assert_api_spec_approvals
;; ;;
cicheck_brpc) cicheck_brpc)
cmake_gen ${PYTHON_ABI:-""} cmake_gen ${PYTHON_ABI:-""}
build build ${parallel_number}
run_brpc_test run_brpc_test
;; ;;
assert_api) assert_api)
...@@ -823,7 +842,7 @@ function main() { ...@@ -823,7 +842,7 @@ function main() {
assert_api_spec_approvals assert_api_spec_approvals
;; ;;
test_inference) test_inference)
gen_fluid_lib gen_fluid_lib ${parallel_number}
test_fluid_lib test_fluid_lib
;; ;;
assert_api_approvals) assert_api_approvals)
...@@ -840,7 +859,7 @@ function main() { ...@@ -840,7 +859,7 @@ function main() {
;; ;;
cicheck_py35) cicheck_py35)
cmake_gen ${PYTHON_ABI:-""} cmake_gen ${PYTHON_ABI:-""}
build build ${parallel_number}
run_test run_test
assert_api_not_changed ${PYTHON_ABI:-""} assert_api_not_changed ${PYTHON_ABI:-""}
;; ;;
...@@ -848,7 +867,7 @@ function main() { ...@@ -848,7 +867,7 @@ function main() {
cmake_gen ${PYTHON_ABI:-""} cmake_gen ${PYTHON_ABI:-""}
;; ;;
gen_fluid_lib) gen_fluid_lib)
gen_fluid_lib gen_fluid_lib ${parallel_number}
;; ;;
test_fluid_lib) test_fluid_lib)
test_fluid_lib test_fluid_lib
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册