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

add BUILD_EXTRA option to build.sh and ci_build.sh (#1849)

上级 1dcb9961
...@@ -63,6 +63,7 @@ Paddle Lite has referenced the following open-source projects: ...@@ -63,6 +63,7 @@ Paddle Lite has referenced the following open-source projects:
- [ARM compute library](http://agroup.baidu.com/paddle-infer/md/article/%28https://github.com/ARM-software/ComputeLibrary%29) - [ARM compute library](http://agroup.baidu.com/paddle-infer/md/article/%28https://github.com/ARM-software/ComputeLibrary%29)
- [Anakin](https://github.com/PaddlePaddle/Anakin). The optimizations under Anakin has been incorporated into Paddle Lite, and so there will not be any future updates of Anakin. As another high-performance inference project under PaddlePaddle, Anakin has been forward-looking and helpful to the making of Paddle Lite. - [Anakin](https://github.com/PaddlePaddle/Anakin). The optimizations under Anakin has been incorporated into Paddle Lite, and so there will not be any future updates of Anakin. As another high-performance inference project under PaddlePaddle, Anakin has been forward-looking and helpful to the making of Paddle Lite.
## Feedback and Community Support ## Feedback and Community Support
- Questions, reports, and suggestions are welcome through Github Issues! - Questions, reports, and suggestions are welcome through Github Issues!
......
...@@ -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"
# global variables
BUILD_EXTRA=OFF
readonly THIRDPARTY_TAR=https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz readonly THIRDPARTY_TAR=https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz
readonly workspace=$PWD readonly workspace=$PWD
...@@ -63,6 +67,7 @@ function make_tiny_publish_so { ...@@ -63,6 +67,7 @@ function make_tiny_publish_so {
-DLITE_SHUTDOWN_LOG=ON \ -DLITE_SHUTDOWN_LOG=ON \
-DLITE_ON_TINY_PUBLISH=ON \ -DLITE_ON_TINY_PUBLISH=ON \
-DANDROID_STL_TYPE=$android_stl \ -DANDROID_STL_TYPE=$android_stl \
-DLITE_BUILD_EXTRA=$BUILD_EXTRA \
-DARM_TARGET_OS=${os} -DARM_TARGET_ARCH_ABI=${abi} -DARM_TARGET_LANG=${lang} -DARM_TARGET_OS=${os} -DARM_TARGET_ARCH_ABI=${abi} -DARM_TARGET_LANG=${lang}
make publish_inference -j4 make publish_inference -j4
...@@ -94,6 +99,7 @@ function make_full_publish_so { ...@@ -94,6 +99,7 @@ function make_full_publish_so {
-DLITE_WITH_JAVA=ON \ -DLITE_WITH_JAVA=ON \
-DLITE_SHUTDOWN_LOG=ON \ -DLITE_SHUTDOWN_LOG=ON \
-DANDROID_STL_TYPE=$android_stl \ -DANDROID_STL_TYPE=$android_stl \
-DLITE_BUILD_EXTRA=$BUILD_EXTRA \
-DARM_TARGET_OS=${os} -DARM_TARGET_ARCH_ABI=${abi} -DARM_TARGET_LANG=${lang} -DARM_TARGET_OS=${os} -DARM_TARGET_ARCH_ABI=${abi} -DARM_TARGET_LANG=${lang}
make publish_inference -j4 make publish_inference -j4
...@@ -120,6 +126,7 @@ function make_all_tests { ...@@ -120,6 +126,7 @@ function make_all_tests {
cmake .. \ cmake .. \
${CMAKE_COMMON_OPTIONS} \ ${CMAKE_COMMON_OPTIONS} \
-DWITH_TESTING=ON \ -DWITH_TESTING=ON \
-DLITE_BUILD_EXTRA=$BUILD_EXTRA \
-DARM_TARGET_OS=${os} -DARM_TARGET_ARCH_ABI=${abi} -DARM_TARGET_LANG=${lang} -DARM_TARGET_OS=${os} -DARM_TARGET_ARCH_ABI=${abi} -DARM_TARGET_LANG=${lang}
make lite_compile_deps -j4 make lite_compile_deps -j4
...@@ -141,8 +148,10 @@ function print_usage { ...@@ -141,8 +148,10 @@ function print_usage {
echo -e "compile all arm tests:" echo -e "compile all arm tests:"
echo -e " ./build.sh --arm_os=<os> --arm_abi=<abi> --arm_lang=<lang> test" echo -e " ./build.sh --arm_os=<os> --arm_abi=<abi> --arm_lang=<lang> test"
echo echo
echo -e "argument choices:" echo -e "optional argument:"
echo -e "--build_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP)"
echo echo
echo -e "argument choices:"
echo -e "--arm_os:\t android" echo -e "--arm_os:\t android"
echo -e "--arm_abi:\t armv8|armv7" echo -e "--arm_abi:\t armv8|armv7"
echo -e "--arm_lang:\t gcc|clang" echo -e "--arm_lang:\t gcc|clang"
...@@ -182,6 +191,10 @@ function main { ...@@ -182,6 +191,10 @@ function main {
ANDROID_STL="${i#*=}" ANDROID_STL="${i#*=}"
shift shift
;; ;;
--build_extra=*)
BUILD_EXTRA="${i#*=}"
shift
;;
tiny_publish) tiny_publish)
make_tiny_publish_so $ARM_OS $ARM_ABI $ARM_LANG $ANDROID_STL make_tiny_publish_so $ARM_OS $ARM_ABI $ARM_LANG $ANDROID_STL
shift shift
......
...@@ -71,6 +71,7 @@ function cmake_opencl { ...@@ -71,6 +71,7 @@ function cmake_opencl {
-DWITH_ARM_DOTPROD=ON \ -DWITH_ARM_DOTPROD=ON \
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON \ -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON \
-DWITH_TESTING=ON \ -DWITH_TESTING=ON \
-DLITE_BUILD_EXTRA=ON \
-DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3 -DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3
} }
...@@ -150,7 +151,8 @@ function build_opencl { ...@@ -150,7 +151,8 @@ function build_opencl {
# This method is only called in CI. # This method is only called in CI.
function cmake_x86_for_CI { function cmake_x86_for_CI {
prepare_workspace # fake an empty __generated_code__.cc to pass cmake. prepare_workspace # fake an empty __generated_code__.cc to pass cmake.
cmake .. -DWITH_GPU=OFF -DWITH_MKLDNN=OFF -DLITE_WITH_X86=ON ${common_flags} -DLITE_WITH_PROFILE=ON -DWITH_MKL=OFF cmake .. -DWITH_GPU=OFF -DWITH_MKLDNN=OFF -DLITE_WITH_X86=ON ${common_flags} -DLITE_WITH_PROFILE=ON -DWITH_MKL=OFF \
-DLITE_BUILD_EXTRA=ON \
# Compile and execute the gen_code related test, so it will generate some code, and make the compilation reasonable. # Compile and execute the gen_code related test, so it will generate some code, and make the compilation reasonable.
# make test_gen_code -j$NUM_CORES_FOR_COMPILE # make test_gen_code -j$NUM_CORES_FOR_COMPILE
...@@ -229,7 +231,8 @@ function build_test_train { ...@@ -229,7 +231,8 @@ function build_test_train {
cd ./build cd ./build
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/paddle/build/third_party/install/mklml/lib" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/paddle/build/third_party/install/mklml/lib"
prepare_workspace # fake an empty __generated_code__.cc to pass cmake. prepare_workspace # fake an empty __generated_code__.cc to pass cmake.
cmake .. -DWITH_LITE=ON -DWITH_GPU=OFF -DWITH_PYTHON=ON -DLITE_WITH_X86=ON -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DWITH_TESTING=ON -DWITH_MKL=OFF cmake .. -DWITH_LITE=ON -DWITH_GPU=OFF -DWITH_PYTHON=ON -DLITE_WITH_X86=ON -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DWITH_TESTING=ON -DWITH_MKL=OFF \
-DLITE_BUILD_EXTRA=ON \
make test_gen_code -j$NUM_CORES_FOR_COMPILE make test_gen_code -j$NUM_CORES_FOR_COMPILE
make test_cxx_api -j$NUM_CORES_FOR_COMPILE make test_cxx_api -j$NUM_CORES_FOR_COMPILE
...@@ -441,6 +444,7 @@ function cmake_npu { ...@@ -441,6 +444,7 @@ function cmake_npu {
-DWITH_TESTING=ON \ -DWITH_TESTING=ON \
-DLITE_WITH_NPU=ON \ -DLITE_WITH_NPU=ON \
-DANDROID_API_LEVEL=24 \ -DANDROID_API_LEVEL=24 \
-DLITE_BUILD_EXTRA=ON \
-DNPU_DDK_ROOT="${build_dir}/../ai_ddk_lib/" \ -DNPU_DDK_ROOT="${build_dir}/../ai_ddk_lib/" \
-DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3 -DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3
} }
...@@ -460,6 +464,7 @@ function cmake_arm { ...@@ -460,6 +464,7 @@ function cmake_arm {
-DWITH_ARM_DOTPROD=ON \ -DWITH_ARM_DOTPROD=ON \
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON \ -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON \
-DWITH_TESTING=ON \ -DWITH_TESTING=ON \
-DLITE_BUILD_EXTRA=ON \
-DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3 -DARM_TARGET_OS=$1 -DARM_TARGET_ARCH_ABI=$2 -DARM_TARGET_LANG=$3
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册