From 3cbba495183f3af1a7d437f6f7ac6f5b0c77ed0b Mon Sep 17 00:00:00 2001
From: Serhii Shepel <9946053+sshepel@users.noreply.github.com>
Date: Tue, 24 Mar 2020 03:55:47 +0200
Subject: [PATCH] Bugfix failing builds (#341)
* Fix interpreter for libnd4j tests and drop test script
* Remove mingw when specifying javacpp.platform, add new profile that triggers when javacpp.platform is windows-x86_64
* Update android 32 bit toolchain for x86
* Try triple instead of -target
* Change to -target
* Update 32 bit arm
* Change android bin path
* Update arm 32 bit build again
Co-authored-by: Adam Gibson <1144306+agibsonccc@users.noreply.github.com>
---
libnd4j/buildnativeoperations.sh | 5 ++--
libnd4j/cmake/android-arm.cmake | 4 +--
libnd4j/cmake/android-x86.cmake | 2 +-
libnd4j/pom.xml | 2 +-
nd4j/compile-android.sh | 1 -
.../nd4j-backend-impls/nd4j-native/pom.xml | 27 ++++++++++++++++++-
6 files changed, 33 insertions(+), 8 deletions(-)
delete mode 100644 nd4j/compile-android.sh
diff --git a/libnd4j/buildnativeoperations.sh b/libnd4j/buildnativeoperations.sh
index af9154866..6a1f93dbb 100755
--- a/libnd4j/buildnativeoperations.sh
+++ b/libnd4j/buildnativeoperations.sh
@@ -220,8 +220,9 @@ case "$OS" in
setandroid_defaults
-
- export ANDROID_BIN="$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/$KERNEL/"
+ # Note here for android 32 bit prefix on the binutils is different
+ # See https://developer.android.com/ndk/guides/other_build_systems
+ export ANDROID_BIN="$ANDROID_NDK/toolchains/arm-linux-androideabi/prebuilt/$KERNEL/"
export ANDROID_CPP="$ANDROID_NDK/sources/cxx-stl/llvm-libc++/"
export ANDROID_CC="$ANDROID_NDK/toolchains/llvm/prebuilt/$KERNEL/bin/clang"
export ANDROID_ROOT="$ANDROID_NDK/platforms/android-$ANDROID_VERSION/arch-arm/"
diff --git a/libnd4j/cmake/android-arm.cmake b/libnd4j/cmake/android-arm.cmake
index 9d150b070..427bc6a34 100644
--- a/libnd4j/cmake/android-arm.cmake
+++ b/libnd4j/cmake/android-arm.cmake
@@ -1,7 +1,7 @@
# CMake toolchain to build for Android 5.0 or newer. Sample usage:
#
set(CMAKE_SYSTEM_NAME Android)
-set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
+set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
set(CMAKE_ANDROID_NDK "$ENV{ANDROID_NDK}")
set(CMAKE_ANDROID_STL_TYPE c++_shared)
set(CMAKE_SYSTEM_VERSION "$ENV{ANDROID_VERSION}")
@@ -18,5 +18,5 @@ endif (WIN32)
-add_definitions(-D__ANDROID_API__=$ENV{ANDROID_VERSION} -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector-strong -target aarch64-none-linux-android -march=armv8-a)
+add_definitions(-D__ANDROID_API__=$ENV{ANDROID_VERSION} -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector-strong -target armv7a-linux-androideabi)
diff --git a/libnd4j/cmake/android-x86.cmake b/libnd4j/cmake/android-x86.cmake
index 7c3297b74..7290b0b8d 100644
--- a/libnd4j/cmake/android-x86.cmake
+++ b/libnd4j/cmake/android-x86.cmake
@@ -18,5 +18,5 @@ endif (WIN32)
-add_definitions(-D__ANDROID_API__=$ENV{ANDROID_VERSION} -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector-strong -target x86-none-linux-android)
+add_definitions(-D__ANDROID_API__=$ENV{ANDROID_VERSION} -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector-strong -target i686-linux-android)
diff --git a/libnd4j/pom.xml b/libnd4j/pom.xml
index 8db086245..d682da24c 100644
--- a/libnd4j/pom.xml
+++ b/libnd4j/pom.xml
@@ -184,7 +184,7 @@
${libnd4j.test.skip}
${basedir}/tests_cpu
- sh
+ bash
run_tests.sh
--chip
${libnd4j.chip}
diff --git a/nd4j/compile-android.sh b/nd4j/compile-android.sh
deleted file mode 100644
index da7fa1799..000000000
--- a/nd4j/compile-android.sh
+++ /dev/null
@@ -1 +0,0 @@
-mvn clean install -Djavacpp.platform=android-arm64 -Dmaven.test.skip=true -Djavacpp.platform.compiler=$ANDROID_NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++
diff --git a/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/pom.xml b/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/pom.xml
index 466bc6264..4026de17e 100644
--- a/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/pom.xml
+++ b/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/pom.xml
@@ -293,6 +293,32 @@
windows
+
+ !javacpp.platform
+
+
+
+
+
+ org.bytedeco
+ javacpp
+
+ ${javacpp.platform}-mingw
+
+
+
+
+
+
+ mingw-windows-platform
+
+
+ windows
+
+
+ javacpp.platform
+ windows-x86_64
+
@@ -306,7 +332,6 @@
-
libnd4j-assembly