未验证 提交 c9deac4a 编写于 作者: E eclipsycn 提交者: GitHub

Merge pull request #567 from dolphin8/develop

fix #558
......@@ -32,6 +32,7 @@ RUN cd /tmp && curl -O http://mirrors.neusoft.edu.cn/android/repository/android-
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 && \
mv cmake-3.10.3-Linux-x86_64 /opt/cmake-3.10 && \
mv /usr/bin/cmake /usr/bin/cmake.bak && ln -s /opt/cmake-3.10/bin/cmake /usr/bin/cmake
mv /usr/bin/cmake /usr/bin/cmake.bak && ln -s /opt/cmake-3.10/bin/cmake /usr/bin/cmake && \
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-r17b-linux-x86_64.zip
ENV NDK_ROOT /opt/android-ndk-r17b
......@@ -19,9 +19,14 @@ paddle-mobile dev 33b146787711 45 hours ago 372MB
```
$ docker run -it --mount type=bind,source=$PWD,target=/paddle-mobile paddle-mobile:dev
root@5affd29d4fc5:/ # cd /paddle-mobile
###
### paddle-mobile 支持 arm 架构下的各种平台,包括 android 以及 linux 等,可以使用不同的
### toolchain 文件生成满足需要的 makefile
###
# 生成构建 android 产出的 Makefile
root@5affd29d4fc5:/ # rm CMakeCache.txt
root@5affd29d4fc5:/ # cmake -DCMAKE_TOOLCHAIN_FILE=tools/toolchains/arm-android-neon.cmake
# 生成构建 linux 产出的 Makefile
root@5affd29d4fc5:/ # rm CMakeCache.txt
root@5affd29d4fc5:/ # cmake -DCMAKE_TOOLCHAIN_FILE=tools/toolchains/arm-linux-gnueabi.cmake
......@@ -56,4 +61,4 @@ root@5affd29d4fc5:/ # make
构架产出可以在 host 机器上查看,在 paddle-mobile 的目录下,build 以及 test/build 下,可以使用 adb 指令或者 scp 传输到 device 上执行
## 不使用 docker
不使用 docker 的方法,可以直接用 cmake 生成 makefile 后构建。使用 ndk 构建 android 应用需要正确设置 NDK_ROOT。构建 linux 应用需要安装 arm-linux-gnueabi-gcc 或者类似的交叉编译工具,可能需要设置 CC,CXX 环境变量,或者在 tools/toolchains/ 中修改 arm-linux-gnueabi.cmake,或者增加自己需要的 toolchain file。
\ No newline at end of file
不使用 docker 的方法,可以直接用 cmake 生成 makefile 后构建。使用 ndk 构建 android 应用需要正确设置 NDK_ROOT。构建 linux 应用需要安装 arm-linux-gnueabi-gcc 或者类似的交叉编译工具,可能需要设置 CC,CXX 环境变量,或者在 tools/toolchains/ 中修改 arm-linux-gnueabi.cmake,或者增加自己需要的 toolchain file。
......@@ -15,6 +15,7 @@ limitations under the License. */
#ifdef ANDROID
#include "paddle_mobile_jni.h"
#include <cmath>
#include "common/log.h"
#include "framework/tensor.h"
#include "io/paddle_mobile.h"
......
......@@ -65,7 +65,7 @@ class PoolFunctor {
const std::vector<int> &paddings, PoolProcess pool_compute,
framework::Tensor *output);
};
}
} // namespace math
} // namespace operators
} // namespace paddle_mobile
......
BEGIN {
print "digraph {"
}
/op:/ {
id++
op = $NF
opname = op "_" id
print opname "[\"label\"=\"" op " [" id "]" "\"]"
}
/input/ {
type = "input"
}
/output/ {
type = "output"
}
/argument/ {
if (type == "output") {
output[$NF] = opname
} else if (type == "input") {
if (output[$NF]) {
print output[$NF] " -> " opname
}
}
}
END {
print "}"
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册