Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

Docker build failed for android in the 'develop' branch

Open graycreate opened this issue 8 years ago • 3 comments

I followed the steps from http://paddlepaddle.org/docs/develop/mobile/zh//cross_compiling_for_android_cn.html to build paddle for android. But failed, I'm in the develop branch.

Below is my Dockerfile.android :

FROM ubuntu:16.04
MAINTAINER PaddlePaddle Authors <[email protected]>

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'

# ENV variables
ARG ANDROID_ABI
ARG ANDROID_API

ENV ANDROID_ABI=${ANDROID_ABI:-"armeabi-v7a"}
ENV ANDROID_API=${ANDROID_API:-21}

ENV HOME=/root \
    ANDROID_NDK_HOME=/opt/android-ndk-linux \
    ANDROID_TOOLCHAINS_DIR=/opt/toolchains

RUN apt-get update && \
    apt-get install -y \
    git python-dev python-pip python-numpy \
    wget curl tar unzip gcc g++ locales clang-format-3.8 swig cmake && \
    apt-get clean -y

# git credential to skip password typing
RUN git config --global credential.helper store

# Fix locales to en_US.UTF-8
RUN localedef -i en_US -f UTF-8 en_US.UTF-8

RUN pip install --upgrade pip==9.0.3 && \
    pip install -U 'protobuf==3.1.0' && \
    pip install -U wheel sphinx && \
    pip install pre-commit

# Android NDK
RUN mkdir -p ${ANDROID_TOOLCHAINS_DIR} && \
    mkdir -p /opt/android-ndk-tmp && \
    cd /opt/android-ndk-tmp && \
    wget -q https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip && \
    unzip -q android-ndk-r14b-linux-x86_64.zip && \
    mv android-ndk-r14b ${ANDROID_NDK_HOME} && \
    rm -rf /opt/android-ndk-tmp

graycreate avatar May 30 '18 06:05 graycreate

你试试按这种方式编译:

sh paddle/scripts/paddle_build.sh build_android

kuke avatar May 30 '18 07:05 kuke

@kuke Doesn't work. image

我之前是用docker来构建的。

graycreate avatar May 30 '18 07:05 graycreate

bash paddle/scripts/paddle_build.sh build_android works

kuke avatar May 30 '18 08:05 kuke