From 249cbf81a37d3f4830fab95c1f23a8b87a8c48f8 Mon Sep 17 00:00:00 2001 From: Yan Chunwei Date: Mon, 26 Aug 2019 14:51:38 +0800 Subject: [PATCH] enhance thirdparty download (#1857) --- lite/tools/build.sh | 23 +++++++++++++++++++++-- lite/tools/ci_build.sh | 21 ++++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/lite/tools/build.sh b/lite/tools/build.sh index 6e1cb7aba9..e406d42f1c 100755 --- a/lite/tools/build.sh +++ b/lite/tools/build.sh @@ -9,6 +9,10 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_GPU=OFF \ -DLITE_WITH_ARM=ON \ -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON" +readonly THIRDPARTY_TAR=https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz + +readonly workspace=$PWD + # for code gen, a source file is generated after a test, but is dependended by some targets in cmake. # here we fake an empty file to make cmake works. function prepare_workspace { @@ -24,6 +28,19 @@ function prepare_workspace { cp ../${DEBUG_TOOL_PATH_PREFIX}/analysis_tool.py ./${DEBUG_TOOL_PATH_PREFIX}/ } +function prepare_thirdparty { + if [ ! -d $workspace/third-party -o -f $workspace/third-party-05b862.tar.gz ]; then + rm -rf $workspace/third-party + + if [ ! -f $workspace/third-party-05b862.tar.gz ]; then + wget $THIRDPARTY_TAR + fi + tar xzf third-party-05b862.tar.gz + else + git submodule update --init --recursive + fi +} + function make_tiny_publish_so { local os=$1 local abi=$2 @@ -58,7 +75,8 @@ function make_full_publish_so { local lang=$3 local android_stl=$4 - git submodule update --init --recursive + #git submodule update --init --recursive + prepare_thirdparty cur_dir=$(pwd) build_dir=$cur_dir/build.lite.${os}.${abi}.${lang} @@ -87,7 +105,8 @@ function make_all_tests { local abi=$2 local lang=$3 - git submodule update --init --recursive + #git submodule update --init --recursive + prepare_thirdparty cur_dir=$(pwd) build_dir=$cur_dir/build.lite.${os}.${abi}.${lang} if [ -d $build_dir ] diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index e3b4d176cf..038252257c 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -4,11 +4,29 @@ set -ex TESTS_FILE="./lite_tests.txt" LIBS_FILE="./lite_libs.txt" + readonly ADB_WORK_DIR="/data/local/tmp" readonly common_flags="-DWITH_LITE=ON -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DWITH_PYTHON=OFF -DWITH_TESTING=ON -DLITE_WITH_ARM=OFF" +readonly THIRDPARTY_TAR=https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz +readonly workspace=$PWD + NUM_CORES_FOR_COMPILE=8 +function prepare_thirdparty { + if [ ! -d $workspace/third-party -o -f $workspace/third-party-05b862.tar.gz ]; then + rm -rf $workspace/third-party + + if [ ! -f $workspace/third-party-05b862.tar.gz ]; then + wget $THIRDPARTY_TAR + fi + tar xzf third-party-05b862.tar.gz + else + git submodule update --init --recursive + fi +} + + # for code gen, a source file is generated after a test, but is dependended by some targets in cmake. # here we fake an empty file to make cmake works. function prepare_workspace { @@ -24,7 +42,8 @@ function prepare_workspace { cp ../${DEBUG_TOOL_PATH_PREFIX}/analysis_tool.py ./${DEBUG_TOOL_PATH_PREFIX}/ # clone submodule - git submodule update --init --recursive + #git submodule update --init --recursive + prepare_thirdparty } function check_need_ci { -- GitLab