未验证 提交 e170ea03 编写于 作者: T tensor-tang 提交者: GitHub

fix cmake deps and update dockerfile (#17635)

上级 4adb6195
# A image for building paddle cross compile
FROM ubuntu:16.04 FROM ubuntu:16.04
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
RUN echo '\ ARG UBUNTU_MIRROR
deb <mirror> <version> main restricted universe multiverse\n\ RUN /bin/bash -c '\
deb <mirror> <version>-updates main restricted universe multiverse\n\ if [[ -n ${UBUNTU_MIRROR} ]]; then \
deb <mirror> <version>-backports main restricted universe multiverse\n\ sed -i 's#http://archive.ubuntu.com/ubuntu#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
deb <mirror> <version>-security main restricted universe multiverse\n'\
> /etc/apt/sources.list
RUN sed -ie 's|<mirror>|http://mirrors.tuna.tsinghua.edu.cn/ubuntu/|' /etc/apt/sources.list
RUN sed -ie 's|<version>|xenial|' /etc/apt/sources.list
RUN apt-get update && apt-get upgrade -y RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \ RUN apt-get install -y --no-install-recommends \
clang-format-3.8 \
cmake-curses-gui \
curl \ curl \
unzip \ fish \
gawk \
gcc \
g++ \
git \ git \
graphviz \
make \ make \
cmake-curses-gui \ patch \
python \ python \
python-pip \ python-pip \
python-setuptools \ python-setuptools \
clang-format-5.0 \ unzip \
graphviz \ vim \
g++-arm-linux-gnueabi \ wget
gcc-arm-linux-gnueabi \
gcc \
g++
RUN apt-get autoremove -y && apt-get clean RUN apt-get autoremove -y && apt-get clean
RUN ln -s clang-format-5.0 /usr/bin/clang-format RUN ln -s clang-format-3.8 /usr/bin/clang-format
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip RUN pip install --upgrade pip
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple wheel RUN pip install pre-commit wheel
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pre-commit
RUN cd /tmp && curl -O https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip 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 && \ 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 && \ 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 && \ ...@@ -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 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 RUN cd /opt && unzip /tmp/android-ndk-r17c-linux-x86_64.zip
ENV NDK_ROOT /opt/android-ndk-r17c 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
...@@ -30,31 +30,34 @@ function(lite_download_and_uncompress INSTALL_DIR URL FILENAME) ...@@ -30,31 +30,34 @@ function(lite_download_and_uncompress INSTALL_DIR URL FILENAME)
) )
endfunction() endfunction()
function (lite_deps DEPS) function (lite_deps TARGET)
set(options "") set(options "")
set(oneValueArgs "") 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}) 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) if(LITE_WITH_X86)
foreach(var ${lite_deps_X86_DEPS}) foreach(var ${lite_deps_X86_DEPS})
set(${DEPS} ${${DEPS}} ${var} PARENT_SCOPE) set(deps ${deps} ${var})
endforeach() endforeach(var)
endif() endif()
if(LITE_WITH_CUDA) if(LITE_WITH_CUDA)
foreach(var ${lite_deps_CUDA_DEPS}) foreach(var ${lite_deps_CUDA_DEPS})
set(${DEPS} ${${DEPS}} ${var} PARENT_SCOPE) set(deps ${deps} ${var})
endforeach() endforeach(var)
endif() endif()
if(LITE_WITH_ARM) if(LITE_WITH_ARM)
foreach(var ${lite_deps_ARM_DEPS}) foreach(var ${lite_deps_ARM_DEPS})
set(${DEPS} ${${DEPS}} ${var} PARENT_SCOPE) set(deps ${deps} ${var})
endforeach() endforeach(var)
endif() endif()
set(${TARGET} ${deps} PARENT_SCOPE)
endfunction() endfunction()
function(lite_cc_library TARGET) function(lite_cc_library TARGET)
...@@ -68,8 +71,7 @@ function(lite_cc_library TARGET) ...@@ -68,8 +71,7 @@ function(lite_cc_library TARGET)
DEPS ${args_DEPS} DEPS ${args_DEPS}
X86_DEPS ${args_X86_DEPS} X86_DEPS ${args_X86_DEPS}
CUDA_DEPS ${args_CUDA_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}) cc_library(${TARGET} SRCS ${args_SRCS} DEPS ${deps} ${args_DEPS})
endfunction() endfunction()
...@@ -85,9 +87,7 @@ function(lite_cc_binary TARGET) ...@@ -85,9 +87,7 @@ function(lite_cc_binary TARGET)
DEPS ${args_DEPS} DEPS ${args_DEPS}
X86_DEPS ${args_X86_DEPS} X86_DEPS ${args_X86_DEPS}
CUDA_DEPS ${args_CUDA_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}) cc_binary(${TARGET} SRCS ${args_SRCS} DEPS ${deps} ${args_DEPS})
endfunction() endfunction()
......
...@@ -17,7 +17,8 @@ endif() ...@@ -17,7 +17,8 @@ endif()
cc_library(light_api_lite SRCS light_api.cc DEPS ${light_api_deps} ${ops_lite} ${host_kernels}) 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 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) include(ExternalProject)
set(LITE_URL "http://paddle-inference-dist.bj.bcebos.com" CACHE STRING "inference download url") set(LITE_URL "http://paddle-inference-dist.bj.bcebos.com" CACHE STRING "inference download url")
......
...@@ -13,7 +13,6 @@ set(arm_kernels ...@@ -13,7 +13,6 @@ set(arm_kernels
fc_compute_arm fc_compute_arm
relu_compute_arm relu_compute_arm
mul_compute_arm mul_compute_arm
scale_compute_arm scale_compute_arm)
)
set(arm_kernels "${arm_kernels}" CACHE INTERNAL "arm kernels") set(arm_kernels "${arm_kernels}" CACHE INTERNAL "arm kernels")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册