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

fix cmake deps and update dockerfile (#17635)

上级 4adb6195
# A image for building paddle cross compile
FROM ubuntu:16.04
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
RUN echo '\
deb <mirror> <version> main restricted universe multiverse\n\
deb <mirror> <version>-updates main restricted universe multiverse\n\
deb <mirror> <version>-backports main restricted universe multiverse\n\
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
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
......@@ -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()
......
......@@ -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")
......
......@@ -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")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册