Compiling Amalgamation for Android

While following what’s described at https://github.com/apache/incubator-mxnet/tree/master/amalgamation

I’m just getting errors…

aarch64-linux-android21-clang++ -std=c++11 -Wno-unknown-pragmas -Wall -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_SSE=0 -DDISABLE_OPENMP=1 -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DDMLC_LOG_STACK_TRACE=0 -DMSHADOW_FORCE_STREAM -DMXNET_USE_OPENCV=0 -DMXNET_PREDICT_ONLY=1 -DMSHADOW_USE_F16C=0 -I../../android-openblas -I../../android-openblas/include -O3 -fPIC -o jni_libmxnet_predict.o -c jni/predictor.cc
In file included from jni/predictor.cc:23:
In file included from jni/../mxnet_predict-all.cc:86:
In file included from /home/ubuntu/Android/Sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/include/x86intrin.h:13:
/home/ubuntu/Android/Sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/include/ia32intrin.h:188:10: error: use of undeclared identifier '__builtin_ia32_readeflags_u32'
  return __builtin_ia32_readeflags_u32();
         ^
/home/ubuntu/Android/Sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/include/ia32intrin.h:194:3: error: use of undeclared identifier '__builtin_ia32_writeeflags_u32'
  __builtin_ia32_writeeflags_u32(__f);
  ^

...

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Makefile:109: jni_libmxnet_predict.o] Error 1

The exact command I ran were:

git clone https://github.com/apache/incubator-mxnet.git
cd incubator-mxnet/
git checkout 1.6.0
git submodule update --init --recursive
cd amalgamation/

export NDK=${HOME}/Android/Sdk/ndk/21.1.6352462
export TOOLCHAIN=${NDK}/toolchains/llvm/prebuilt/linux-x86_64
export PATH=${TOOLCHAIN}/bin:${PATH}
export CC=aarch64-linux-androideabi21-clang
export CXX=aarch64-linux-android21-clang++
export AR=aarch64-linux-android-ar

make OPENBLAS_ROOT=../../android-openblas ANDROID=1

Help please

I unsuccessfully tried using Amalgamation as well. I asked for help both here and on Stack Overflow, and they suggested me to follow this alternative approach..
I didn’t try it yet, so I can’t really tell you much about it.

Thanks, I already use ONNX with OpenCV DNN on Android, the this is not all symbols can be exported to ONNX format.

For example, shufflenet channel shuffle cannot be exported due to the negative transpose arguments…