diff --git a/lite/tools/build.sh b/lite/tools/build.sh index ee12feb18ccfaf793a153cf46da546873b58b512..6ec275c77481a8e43f80579a27e00572a4a53a76 100755 --- a/lite/tools/build.sh +++ b/lite/tools/build.sh @@ -9,6 +9,8 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_GPU=OFF \ -DLITE_WITH_ARM=ON \ -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON" +readonly NUM_PROC=${LITE_BUILD_THREADS:-4} + # global variables BUILD_EXTRA=OFF @@ -70,7 +72,7 @@ function make_tiny_publish_so { -DLITE_BUILD_EXTRA=$BUILD_EXTRA \ -DARM_TARGET_OS=${os} -DARM_TARGET_ARCH_ABI=${abi} -DARM_TARGET_LANG=${lang} - make publish_inference -j4 + make publish_inference -j$NUM_PROC cd - > /dev/null } diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index 248550c9cdedc9bff9aa7a74cddb9ef342d8364b..80432f4378cd615109c0647b8667cc69417bbe6a 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -11,7 +11,7 @@ readonly common_flags="-DWITH_LITE=ON -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DW readonly THIRDPARTY_TAR=https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz readonly workspace=$PWD -NUM_CORES_FOR_COMPILE=8 +NUM_CORES_FOR_COMPILE=${LITE_BUILD_THREADS:-8} function prepare_thirdparty { if [ ! -d $workspace/third-party -o -f $workspace/third-party-05b862.tar.gz ]; then