From 4a5dd62b22e8a14b75a572de23beb921ab6d1440 Mon Sep 17 00:00:00 2001 From: Yiqun Liu Date: Fri, 2 Mar 2018 15:11:11 +0800 Subject: [PATCH] Try to add build_android task back to travis. (#8699) --- .travis.yml | 10 +++++++-- CMakeLists.txt | 2 +- paddle/scripts/docker/build_android.sh | 1 - paddle/scripts/travis/build_android.sh | 31 -------------------------- 4 files changed, 9 insertions(+), 35 deletions(-) delete mode 100755 paddle/scripts/travis/build_android.sh diff --git a/.travis.yml b/.travis.yml index e2d49daa198..ed566016ec6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,17 @@ cache: - $HOME/.ccache - $HOME/.cache/pip - $TRAVIS_BUILD_DIR/build/third_party + - $TRAVIS_BUILD_DIR/build_android/third_party sudo: required dist: trusty +services: + - docker os: - linux env: - JOB=build_doc - JOB=check_style + - JOB=build_android addons: apt: packages: @@ -41,8 +45,10 @@ before_install: function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } script: - | - timeout 2580 paddle/scripts/travis/${JOB}.sh # 43min timeout - RESULT=$?; if [ $RESULT -eq 0 ] || [ $RESULT -eq 142 ]; then true ;else exit 1; fi; + # 43min timeout + if [[ "$JOB" == "build_android" ]]; then timeout 2580 docker run -it --rm -v "$TRAVIS_BUILD_DIR:/paddle" paddlepaddle/paddle:latest-dev-android; + else timeout 2580 paddle/scripts/travis/${JOB}.sh; fi; + RESULT=$?; if [ $RESULT -eq 0 ] || [ $RESULT -eq 142 ]; then true; else exit 1; fi; - | if [[ "$JOB" != "build_doc" ]]; then exit 0; fi; if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi; diff --git a/CMakeLists.txt b/CMakeLists.txt index 178050dc791..469af0f7859 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,7 +168,7 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/go/pserver/client/c") set(EXTERNAL_LIBS gflags glog - cblas + ${CBLAS_LIBRARIES} protobuf zlib ${PYTHON_LIBRARIES} diff --git a/paddle/scripts/docker/build_android.sh b/paddle/scripts/docker/build_android.sh index cd13073a0c2..3d5e775fafb 100644 --- a/paddle/scripts/docker/build_android.sh +++ b/paddle/scripts/docker/build_android.sh @@ -31,7 +31,6 @@ ${ANDROID_NDK_HOME}/build/tools/make-standalone-toolchain.sh \ BUILD_ROOT=/paddle/build_android DEST_ROOT=/paddle/install_android -rm -rf $BUILD_ROOT 2>/dev/null || true mkdir -p $BUILD_ROOT cd $BUILD_ROOT diff --git a/paddle/scripts/travis/build_android.sh b/paddle/scripts/travis/build_android.sh deleted file mode 100755 index 9da71d1e8cd..00000000000 --- a/paddle/scripts/travis/build_android.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -set -e - -ANDROID_STANDALONE_TOOLCHAIN=$HOME/android-toolchain-gcc -TMP_DIR=$HOME/$JOB/tmp -mkdir -p $TMP_DIR -cd $TMP_DIR -wget -q https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip -unzip -q android-ndk-r14b-linux-x86_64.zip -chmod +x $TMP_DIR/android-ndk-r14b/build/tools/make-standalone-toolchain.sh -$TMP_DIR/android-ndk-r14b/build/tools/make-standalone-toolchain.sh --force --arch=arm --platform=android-21 --install-dir=$ANDROID_STANDALONE_TOOLCHAIN -cd $HOME -rm -rf $TMP_DIR - -# Create the build directory for CMake. -mkdir -p $TRAVIS_BUILD_DIR/build_android -cd $TRAVIS_BUILD_DIR/build_android - -# Compile paddle binaries -cmake -DCMAKE_SYSTEM_NAME=Android \ - -DANDROID_STANDALONE_TOOLCHAIN=$ANDROID_STANDALONE_TOOLCHAIN \ - -DANDROID_ABI=armeabi-v7a \ - -DANDROID_ARM_NEON=ON \ - -DANDROID_ARM_MODE=ON \ - -DUSE_EIGEN_FOR_BLAS=ON \ - -DWITH_C_API=ON \ - -DWITH_SWIG_PY=OFF \ - -DWITH_STYLE_CHECK=OFF \ - .. - -make -j `nproc` -- GitLab