未验证 提交 0d56d6fe 编写于 作者: Y Yan Chunwei 提交者: GitHub

enhance thirdparty download (#1857)

上级 05b86272
...@@ -9,6 +9,10 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_GPU=OFF \ ...@@ -9,6 +9,10 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_GPU=OFF \
-DLITE_WITH_ARM=ON \ -DLITE_WITH_ARM=ON \
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=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. # 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. # here we fake an empty file to make cmake works.
function prepare_workspace { function prepare_workspace {
...@@ -24,6 +28,19 @@ function prepare_workspace { ...@@ -24,6 +28,19 @@ function prepare_workspace {
cp ../${DEBUG_TOOL_PATH_PREFIX}/analysis_tool.py ./${DEBUG_TOOL_PATH_PREFIX}/ 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 { function make_tiny_publish_so {
local os=$1 local os=$1
local abi=$2 local abi=$2
...@@ -58,7 +75,8 @@ function make_full_publish_so { ...@@ -58,7 +75,8 @@ function make_full_publish_so {
local lang=$3 local lang=$3
local android_stl=$4 local android_stl=$4
git submodule update --init --recursive #git submodule update --init --recursive
prepare_thirdparty
cur_dir=$(pwd) cur_dir=$(pwd)
build_dir=$cur_dir/build.lite.${os}.${abi}.${lang} build_dir=$cur_dir/build.lite.${os}.${abi}.${lang}
...@@ -87,7 +105,8 @@ function make_all_tests { ...@@ -87,7 +105,8 @@ function make_all_tests {
local abi=$2 local abi=$2
local lang=$3 local lang=$3
git submodule update --init --recursive #git submodule update --init --recursive
prepare_thirdparty
cur_dir=$(pwd) cur_dir=$(pwd)
build_dir=$cur_dir/build.lite.${os}.${abi}.${lang} build_dir=$cur_dir/build.lite.${os}.${abi}.${lang}
if [ -d $build_dir ] if [ -d $build_dir ]
......
...@@ -4,11 +4,29 @@ set -ex ...@@ -4,11 +4,29 @@ set -ex
TESTS_FILE="./lite_tests.txt" TESTS_FILE="./lite_tests.txt"
LIBS_FILE="./lite_libs.txt" LIBS_FILE="./lite_libs.txt"
readonly ADB_WORK_DIR="/data/local/tmp" 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 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 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. # 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. # here we fake an empty file to make cmake works.
function prepare_workspace { function prepare_workspace {
...@@ -24,7 +42,8 @@ function prepare_workspace { ...@@ -24,7 +42,8 @@ function prepare_workspace {
cp ../${DEBUG_TOOL_PATH_PREFIX}/analysis_tool.py ./${DEBUG_TOOL_PATH_PREFIX}/ cp ../${DEBUG_TOOL_PATH_PREFIX}/analysis_tool.py ./${DEBUG_TOOL_PATH_PREFIX}/
# clone submodule # clone submodule
git submodule update --init --recursive #git submodule update --init --recursive
prepare_thirdparty
} }
function check_need_ci { function check_need_ci {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册