提交 39a3788d 编写于 作者: 朔-望's avatar 朔-望 提交者: GitHub

Merge pull request #295 from allonli/develop

fix ubuntu compile
...@@ -11,6 +11,24 @@ This project is used to develop the next version deep learning freamwork for mob ...@@ -11,6 +11,24 @@ This project is used to develop the next version deep learning freamwork for mob
[Used model in development](https://mms-mis.cdn.bcebos.com/paddle-mobile/models.zip) [Used model in development](https://mms-mis.cdn.bcebos.com/paddle-mobile/models.zip)
## cross-compilation to android
* NDK is required
* ANDROID_NDK environment variable is required
```bash
sh build.sh android
```
## build for x86
paddle-mobile is to run on arm platform. x86 only used to test not arm assembly code. So do not recommend compiling x86.
Now only support osx.
```
sh build.sh mac
```
## Old Version of Mobile-Deep-Learning ## Old Version of Mobile-Deep-Learning
The old version of MDL was I moved to here [Mobile-Deep-Learning](https://github.com/allonli/mobile-deep-learning) The old version of MDL was I moved to here [Mobile-Deep-Learning](https://github.com/allonli/mobile-deep-learning)
......
#!/bin/bash #!/usr/bin/env bash
build_for_linux() {
if [ ! `which brew` ]; then
echo "building failed! homebrew not found, please install homebrew."
return
fi
if [ ! `which cmake` ]; then
echo "installing cmake."
brew install cmake
if [ ! $? ]; then
echo "cmake install failed."
return
fi
fi
PLATFORM="x86"
MODE="Release"
CXX_FLAGS="-std=c++11 -O3 -s"
BUILD_DIR=build/release/"${PLATFORM}"
mkdir -p ${BUILD_DIR}/build
mkdir -p ${BUILD_DIR}/test
cp -r test/models ${BUILD_DIR}/test/models
cmake . \
-B"${BUILD_DIR}" \
-DCMAKE_BUILD_TYPE="${MODE}" \
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}" \
-DIS_MAC=true
cd ${BUILD_DIR}
make -j 8
}
build_for_mac() { build_for_mac() {
if [ ! `which brew` ]; then if [ ! `which brew` ]; then
...@@ -65,8 +33,8 @@ build_for_mac() { ...@@ -65,8 +33,8 @@ build_for_mac() {
} }
build_for_android() { build_for_android() {
if [ -z "${NDK_ROOT}" ]; then if [ -z "${ANDROID_NDK}" ]; then
echo "NDK_ROOT not found!" echo "ANDROID_NDK not found!"
exit -1 exit -1
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册