You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/15 17:33:36 UTC
[GitHub] marcoabreu closed pull request #11055: [MXNET-57] Added support
android64
marcoabreu closed pull request #11055: [MXNET-57] Added support android64
URL: https://github.com/apache/incubator-mxnet/pull/11055
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e57c00b69e9..764e8cc4623 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,7 +15,7 @@ mxnet_option(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
mxnet_option(USE_OPENCV "Build with OpenCV support" ON)
mxnet_option(USE_OPENMP "Build with Openmp support" ON)
mxnet_option(USE_CUDNN "Build with cudnn support" ON) # one could set CUDNN_ROOT for search path
-mxnet_option(USE_SSE "Build with x86 SSE instruction support" ON)
+mxnet_option(USE_SSE "Build with x86 SSE instruction support" ON IF NOT ARM)
mxnet_option(USE_F16C "Build with x86 F16C instruction support" ON) # autodetects support if ON
mxnet_option(USE_LAPACK "Build with lapack support" ON)
mxnet_option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON)
@@ -360,7 +360,7 @@ if(USE_OPENMP)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
endif()
-elseif(UNIX)
+elseif(UNIX AND NOT ANDROID)
list(APPEND mxnet_LINKER_LIBS pthread)
endif()
diff --git a/Jenkinsfile b/Jenkinsfile
index 28edda00959..61b63807703 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -458,6 +458,16 @@ try {
}
}
}
+ },
+ 'Android / ARM64':{
+ node('mxnetlinux-cpu') {
+ ws('workspace/android64') {
+ timeout(time: max_time, unit: 'MINUTES') {
+ init_git()
+ docker_run('android_arm64', 'build_android_arm64', false)
+ }
+ }
+ }
}
} // End of stage('Build')
diff --git a/ci/docker/Dockerfile.build.android_arm64 b/ci/docker/Dockerfile.build.android_arm64
index 4bd4fd30922..4dbc49d163a 100755
--- a/ci/docker/Dockerfile.build.android_arm64
+++ b/ci/docker/Dockerfile.build.android_arm64
@@ -31,10 +31,7 @@ MAINTAINER Pedro Larroy "pllarroy@amazon.com"
# extract ccache binary into latest context
COPY --from=ccachebuilder /usr/local/bin/ccache /usr/local/bin/ccache
-# The cross-compiling emulator
RUN apt-get update && apt-get install -y \
- qemu-user \
- qemu-user-static \
unzip
ENV CROSS_TRIPLE=aarch64-linux-android
@@ -61,6 +58,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.schema-version="1.0"
ENV ARCH aarch64
+ENV ANDROID_NDK_REVISION 15c
ENV CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang
ENV CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++
diff --git a/ci/docker/install/android_arm64_ndk.sh b/ci/docker/install/android_arm64_ndk.sh
index 23d9ea2c0e9..04023fbdebe 100755
--- a/ci/docker/install/android_arm64_ndk.sh
+++ b/ci/docker/install/android_arm64_ndk.sh
@@ -22,7 +22,8 @@
set -ex
pushd .
-export ANDROID_NDK_REVISION=15c
+# This environment variable comes from the docker file
+echo "Downloading android SDK rev ${ANDROID_NDK_REVISION}"
curl -O https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \
unzip ./android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \
cd android-ndk-r${ANDROID_NDK_REVISION} && \
@@ -32,4 +33,4 @@ cd android-ndk-r${ANDROID_NDK_REVISION} && \
--api 21 \
--install-dir=${CROSS_ROOT} && \
-popd
\ No newline at end of file
+popd
diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 36e23879705..1cb63f2587e 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -173,20 +173,21 @@ build_arm64() {
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DUSE_CUDA=OFF\
+ -DSUPPORT_F16C=OFF\
-DUSE_OPENCV=OFF\
-DUSE_OPENMP=OFF\
-DUSE_SIGNAL_HANDLER=ON\
-DCMAKE_BUILD_TYPE=RelWithDebInfo\
-DUSE_MKL_IF_AVAILABLE=OFF\
-G Ninja /work/mxnet
- ninja
+ ninja -v
export MXNET_LIBRARY_PATH=`pwd`/libmxnet.so
cd /work/mxnet/python
python setup.py bdist_wheel --universal
cp dist/*.whl /work/build
}
-build_android_arm64() {
+build_android_armv7() {
set -ex
cd /work/build
cmake \
@@ -194,6 +195,7 @@ build_android_arm64() {
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DUSE_CUDA=OFF\
-DUSE_SSE=OFF\
+ -DSUPPORT_F16C=OFF\
-DUSE_LAPACK=OFF\
-DUSE_OPENCV=OFF\
-DUSE_OPENMP=OFF\
@@ -201,13 +203,37 @@ build_android_arm64() {
-DCMAKE_BUILD_TYPE=RelWithDebInfo\
-DUSE_MKL_IF_AVAILABLE=OFF\
-G Ninja /work/mxnet
- ninja
+ ninja -v
export MXNET_LIBRARY_PATH=`pwd`/libmxnet.so
cd /work/mxnet/python
python setup.py bdist_wheel --universal
cp dist/*.whl /work/build
}
+build_android_arm64() {
+ set -ex
+ cd /work/build
+# There are other ways for CMake to cross compile android, like setting the following variables
+# below. But right not it doesn't work as expected, we need to find what's the best strategy to
+# build with CMake in Android.
+# -DCMAKE_ANDROID_NDK=${CROSS_ROOT} \
+# -DCMAKE_SYSTEM_VERSION=${ANDROID_NDK_REVISION} \
+# -DCMAKE_SYSTEM_NAME=Android \
+#
+ cmake\
+ -DANDROID=ON \
+ -DUSE_CUDA=OFF\
+ -DUSE_SSE=OFF\
+ -DUSE_LAPACK=OFF\
+ -DUSE_OPENCV=OFF\
+ -DUSE_OPENMP=OFF\
+ -DUSE_SIGNAL_HANDLER=ON\
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo\
+ -DUSE_MKL_IF_AVAILABLE=OFF\
+ -G Ninja /work/mxnet
+ ninja -v
+}
+
build_centos7_cpu() {
set -ex
cd /work/mxnet
diff --git a/src/operator/random/shuffle_op.cc b/src/operator/random/shuffle_op.cc
index 983f879888c..83c9034e364 100644
--- a/src/operator/random/shuffle_op.cc
+++ b/src/operator/random/shuffle_op.cc
@@ -22,8 +22,9 @@
* \file shuffle_op.cc
* \brief Operator to shuffle elements of an NDArray
*/
-#if (__GNUC__ > 4 && !defined(__clang__major__)) || (__clang_major__ > 4 && __linux__)
- #define USE_GNU_PARALLEL_SHUFFLE
+#if !defined (__ANDROID__) && ((__GNUC__ > 4 &&\
+ !defined(__clang__major__)) || (__clang_major__ > 4 && __linux__))
+ #define USE_GNU_PARALLEL_SHUFFLE
#endif
#include <mxnet/operator_util.h>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services