diff --git a/Dockerfile.android b/Dockerfile.android index 185740df1b01ebef6828e16ef51db9afb1d2dd0e..2245a1e71a65aabfb09b2eef43ef42b9068bcd93 100644 --- a/Dockerfile.android +++ b/Dockerfile.android @@ -1,35 +1,36 @@ +# A image for building paddle cross compile FROM ubuntu:16.04 +MAINTAINER PaddlePaddle Authors -RUN echo '\ -deb main restricted universe multiverse\n\ -deb -updates main restricted universe multiverse\n\ -deb -backports main restricted universe multiverse\n\ -deb -security main restricted universe multiverse\n'\ -> /etc/apt/sources.list -RUN sed -ie 's||http://mirrors.tuna.tsinghua.edu.cn/ubuntu/|' /etc/apt/sources.list -RUN sed -ie 's||xenial|' /etc/apt/sources.list +ARG UBUNTU_MIRROR +RUN /bin/bash -c '\ +if [[ -n ${UBUNTU_MIRROR} ]]; then \ +sed -i 's#http://archive.ubuntu.com/ubuntu#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi' RUN apt-get update && apt-get upgrade -y RUN apt-get install -y --no-install-recommends \ + clang-format-3.8 \ + cmake-curses-gui \ curl \ - unzip \ + fish \ + gawk \ + gcc \ + g++ \ git \ + graphviz \ make \ - cmake-curses-gui \ + patch \ python \ python-pip \ python-setuptools \ - clang-format-5.0 \ - graphviz \ - g++-arm-linux-gnueabi \ - gcc-arm-linux-gnueabi \ - gcc \ - g++ + unzip \ + vim \ + wget + RUN apt-get autoremove -y && apt-get clean -RUN ln -s clang-format-5.0 /usr/bin/clang-format -RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip -RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple wheel -RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pre-commit +RUN ln -s clang-format-3.8 /usr/bin/clang-format +RUN pip install --upgrade pip +RUN pip install pre-commit wheel RUN cd /tmp && curl -O https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip RUN curl -O https://mms-res.cdn.bcebos.com/cmake-3.10.3-Linux-x86_64.tar.gz && \ tar xzf cmake-3.10.3-Linux-x86_64.tar.gz && \ @@ -38,3 +39,4 @@ RUN curl -O https://mms-res.cdn.bcebos.com/cmake-3.10.3-Linux-x86_64.tar.gz && \ mv /usr/bin/ccmake /usr/bin/ccmake.bak && ln -s /opt/cmake-3.10/bin/ccmake /usr/bin/ccmake RUN cd /opt && unzip /tmp/android-ndk-r17c-linux-x86_64.zip ENV NDK_ROOT /opt/android-ndk-r17c +RUN rm -rf /tmp/android-ndk-r17c-linux-x86_64.zip /cmake-3.10.3-Linux-x86_64.tar.gz diff --git a/paddle/fluid/lite/CMakeLists.txt b/paddle/fluid/lite/CMakeLists.txt index a1a1f2ab68173782e19369063249cf8e59fcf096..ba05973a863a2a6b81ec7e9963c36b7c8f85e67a 100644 --- a/paddle/fluid/lite/CMakeLists.txt +++ b/paddle/fluid/lite/CMakeLists.txt @@ -30,31 +30,34 @@ function(lite_download_and_uncompress INSTALL_DIR URL FILENAME) ) endfunction() -function (lite_deps DEPS) +function (lite_deps TARGET) set(options "") set(oneValueArgs "") - set(multiValueArgs DEPS X86_DEPS CUDA_DEPS ARM_DEPS) + set(multiValueArgs DEPS X86_DEPS CUDA_DEPS ARM_DEPS ARGS) cmake_parse_arguments(lite_deps "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(${DEPS} ${lite_deps_DEPS} PARENT_SCOPE) + set(deps ${lite_deps_DEPS}) if(LITE_WITH_X86) foreach(var ${lite_deps_X86_DEPS}) - set(${DEPS} ${${DEPS}} ${var} PARENT_SCOPE) - endforeach() + set(deps ${deps} ${var}) + endforeach(var) endif() if(LITE_WITH_CUDA) foreach(var ${lite_deps_CUDA_DEPS}) - set(${DEPS} ${${DEPS}} ${var} PARENT_SCOPE) - endforeach() + set(deps ${deps} ${var}) + endforeach(var) endif() if(LITE_WITH_ARM) foreach(var ${lite_deps_ARM_DEPS}) - set(${DEPS} ${${DEPS}} ${var} PARENT_SCOPE) - endforeach() + set(deps ${deps} ${var}) + endforeach(var) endif() + + set(${TARGET} ${deps} PARENT_SCOPE) + endfunction() function(lite_cc_library TARGET) @@ -68,8 +71,7 @@ function(lite_cc_library TARGET) DEPS ${args_DEPS} X86_DEPS ${args_X86_DEPS} CUDA_DEPS ${args_CUDA_DEPS} - ARM_DEPS ${args_ARM_DEPS} - ) + ARM_DEPS ${args_ARM_DEPS}) cc_library(${TARGET} SRCS ${args_SRCS} DEPS ${deps} ${args_DEPS}) endfunction() @@ -85,9 +87,7 @@ function(lite_cc_binary TARGET) DEPS ${args_DEPS} X86_DEPS ${args_X86_DEPS} CUDA_DEPS ${args_CUDA_DEPS} - ARM_DEPS ${args_ARM_DEPS} - ) - + ARM_DEPS ${args_ARM_DEPS}) cc_binary(${TARGET} SRCS ${args_SRCS} DEPS ${deps} ${args_DEPS}) endfunction() diff --git a/paddle/fluid/lite/api/CMakeLists.txt b/paddle/fluid/lite/api/CMakeLists.txt index 3ec3eb155f11149b3f3837a4577e219f5075d179..cea38089fbe57cdcde1b9d15efecc637bf054499 100644 --- a/paddle/fluid/lite/api/CMakeLists.txt +++ b/paddle/fluid/lite/api/CMakeLists.txt @@ -17,7 +17,8 @@ endif() cc_library(light_api_lite SRCS light_api.cc DEPS ${light_api_deps} ${ops_lite} ${host_kernels}) message(STATUS "get ops ${ops_lite}") -message(STATUS "get kernels ${host_kernels} ${arm_kernels}") +message(STATUS "get Host kernels ${host_kernels}") +message(STATUS "get ARM kernels ${arm_kernels}") include(ExternalProject) set(LITE_URL "http://paddle-inference-dist.bj.bcebos.com" CACHE STRING "inference download url") diff --git a/paddle/fluid/lite/kernels/arm/CMakeLists.txt b/paddle/fluid/lite/kernels/arm/CMakeLists.txt index b4001a003c37ad8117773aceb8327f232d905bd3..b5fc0bdea8a719648d606bbd215cb1564834183a 100644 --- a/paddle/fluid/lite/kernels/arm/CMakeLists.txt +++ b/paddle/fluid/lite/kernels/arm/CMakeLists.txt @@ -13,7 +13,6 @@ set(arm_kernels fc_compute_arm relu_compute_arm mul_compute_arm - scale_compute_arm - ) + scale_compute_arm) set(arm_kernels "${arm_kernels}" CACHE INTERNAL "arm kernels")