-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build_android task on Travis CI. #2845
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
ANDROID_STANDALONE_TOOLCHAIN=$HOME/android-toolchain-gcc | ||
TMP_DIR=$HOME/$JOB/tmp | ||
mkdir -p $TMP_DIR | ||
cd $TMP_DIR | ||
wget -q https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip | ||
unzip -q android-ndk-r14b-linux-x86_64.zip | ||
chmod +x $TMP_DIR/android-ndk-r14b/build/tools/make-standalone-toolchain.sh | ||
$TMP_DIR/android-ndk-r14b/build/tools/make-standalone-toolchain.sh --force --arch=arm --platform=android-21 --install-dir=$ANDROID_STANDALONE_TOOLCHAIN | ||
cd $HOME | ||
rm -rf $TMP_DIR | ||
|
||
# Create the build directory for CMake. | ||
mkdir -p $TRAVIS_BUILD_DIR/build_android | ||
cd $TRAVIS_BUILD_DIR/build_android | ||
|
||
# Compile paddle binaries | ||
cmake -DCMAKE_SYSTEM_NAME=Android \ | ||
-DANDROID_STANDALONE_TOOLCHAIN=$ANDROID_STANDALONE_TOOLCHAIN \ | ||
-DANDROID_ABI=armeabi-v7a \ | ||
-DANDROID_ARM_NEON=ON \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -DWITH_TESTING=OFF disable build the test binaries There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 线下编译的时候,一般都设置 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 明白了 |
||
-DANDROID_ARM_MODE=ON \ | ||
-DWITH_C_API=ON \ | ||
-DWITH_SWIG_PY=OFF \ | ||
-DWITH_STYLE_CHECK=OFF \ | ||
.. | ||
|
||
make -j `nproc` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之后会考虑类似arm64-v8a吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arm64-v8a
的编译,@hedaoyuan 已经在#2816 中支持了,若觉得有必要,可以直接在这个脚本里加上There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
经过和@gangliao 讨论,在Travis CI中增加
build_android
编译任务的主要目的,是为了防止后续cmake的更新,导致android版编译失败,因而不需要再增加arm64-v8a
的编译测试。