androidcmakeopenvinocmake-guiintel-myriadx

Building Openvino for Android using Cmake


I tried to build openvino for Android devices (arm64) using Cmake, to do that I followed the following steps:

Operating system: Ubuntu 20

1 - I installed OpenJDK 8 using:

sudo apt-get install -y openjdk-8-jdk

2 - I downloaded the android NDK for linux using:

wget https://dl.google.com/android/repository/android-ndk-r20-linux-x86_64.zip

3 - I cloned the OpenVINO and OpenVINO Contrib repositories using:

git clone --recurse-submodules --shallow-submodules --depth 1 --branch=2021.4.1 https://github.com/openvinotoolkit/openvino.git
git clone --recurse-submodules --shallow-submodules --depth 1 --branch=2021.4 https://github.com/openvinotoolkit/openvino_contrib.git

4 - I built openvino using cmake:

cmake -DCMAKE_BUILD_TYPE=Release -DTHREADING=SEQ -DIE_EXTRA_MODULES=../../openvino_contrib/modules  -DBUILD_java_api=ON -DCMAKE_TOOLCHAIN_FILE=../../android-ndk-r20/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=24 -DANDROID_STL=c++_shared -DENABLE_SAMPLES=OFF -DENABLE_OPENCV=OFF -DENABLE_CLDNN=OFF -DENABLE_TESTS=OFF -DENABLE_GAPI_TESTS=OFF -DENABLE_BEH_TESTS=OFF -DENABLE_PYTHON=OFF .. && make --jobs=$(nproc --all)

Expectations:

As many tutorials showed it I was expecting a file called inference_engine_java_api.jar to be generated in this path: openvino/bin/aarch64/Release/lib/

Results:

I didn't get any file which has _java_api in its name. I just got some .so and .a files like: inference_engine_c_api.so and inference_engine_legacy.so.


Solution

  • You just need to install: scons in ubuntu.

    sudo apt-get update
    sudo apt-get install scons