From f12525900c4c41ad4ceaed9f010b332a5c99c7da Mon Sep 17 00:00:00 2001 From: guofei <52460041+gfwm2013@users.noreply.github.com> Date: Sat, 31 Aug 2019 18:30:48 +0800 Subject: [PATCH] lite can build armlinux and remove build_armlinux.sh test=develop (#1932) --- lite/CMakeLists.txt | 2 +- lite/tools/build.sh | 13 ++++++++++-- lite/tools/build_armlinux.sh | 39 ------------------------------------ 3 files changed, 12 insertions(+), 42 deletions(-) delete mode 100755 lite/tools/build_armlinux.sh diff --git a/lite/CMakeLists.txt b/lite/CMakeLists.txt index 7606507fba..c77d70a7f3 100644 --- a/lite/CMakeLists.txt +++ b/lite/CMakeLists.txt @@ -90,7 +90,7 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM) COMMAND ${CMAKE_STRIP} "--strip-debug" ${INFER_LITE_PUBLISH_ROOT}/cxx/lib/*.a) endif() else() - if (IOS) + if (IOS OR (ARM_TARGET_OS STREQUAL "armlinux")) add_custom_target(tiny_publish_lib ${TARGET} COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/lib" COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/include" diff --git a/lite/tools/build.sh b/lite/tools/build.sh index 0edeeeede3..0860f3d00e 100755 --- a/lite/tools/build.sh +++ b/lite/tools/build.sh @@ -14,6 +14,7 @@ readonly NUM_PROC=${LITE_BUILD_THREADS:-4} # global variables BUILD_EXTRA=OFF +BUILD_JAVA=ON readonly THIRDPARTY_TAR=https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz @@ -62,10 +63,14 @@ function make_tiny_publish_so { mkdir -p $build_dir cd $build_dir + if [ ${os} == "armlinux" ]; then + BUILD_JAVA=OFF + fi + cmake .. \ ${CMAKE_COMMON_OPTIONS} \ -DWITH_TESTING=OFF \ - -DLITE_WITH_JAVA=ON \ + -DLITE_WITH_JAVA=$BUILD_JAVA \ -DLITE_SHUTDOWN_LOG=ON \ -DLITE_ON_TINY_PUBLISH=ON \ -DANDROID_STL_TYPE=$android_stl \ @@ -93,12 +98,16 @@ function make_full_publish_so { fi mkdir -p $build_dir cd $build_dir + + if [ ${os} == "armlinux" ]; then + BUILD_JAVA=OFF + fi prepare_workspace cmake .. \ ${CMAKE_COMMON_OPTIONS} \ -DWITH_TESTING=OFF \ - -DLITE_WITH_JAVA=ON \ + -DLITE_WITH_JAVA=$BUILD_JAVA \ -DLITE_SHUTDOWN_LOG=ON \ -DANDROID_STL_TYPE=$android_stl \ -DLITE_BUILD_EXTRA=$BUILD_EXTRA \ diff --git a/lite/tools/build_armlinux.sh b/lite/tools/build_armlinux.sh deleted file mode 100755 index 3c240ccea9..0000000000 --- a/lite/tools/build_armlinux.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -os=armlinux -abi=armv8 -lang=gcc - -if [ x$1 != x ]; then - abi=$1 -fi - -if [ x$2 != x ]; then - lang=$2 -fi - -cur_dir=$(pwd) -build_dir=$cur_dir/build.lite.${os}.${abi}.${lang} -mkdir -p $build_dir -cd $build_dir - -GEN_CODE_PATH_PREFIX=lite/gen_code -mkdir -p ./${GEN_CODE_PATH_PREFIX} -touch ./${GEN_CODE_PATH_PREFIX}/__generated_code__.cc - -cmake .. \ - -DWITH_GPU=OFF \ - -DWITH_MKL=OFF \ - -DWITH_LITE=ON \ - -DLITE_WITH_CUDA=OFF \ - -DLITE_WITH_X86=OFF \ - -DLITE_WITH_ARM=ON \ - -DWITH_ARM_DOTPROD=ON \ - -DLITE_WITH_OPENMP=ON \ - -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON \ - -DWITH_TESTING=ON \ - -DARM_TARGET_OS=${os} -DARM_TARGET_ARCH_ABI=${abi} -DARM_TARGET_LANG=${lang} - -make -j4 publish_inference - -cd - -- GitLab