- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello ,
I have been trying to build openvino ( .jar) and related (.so ) for my openvino object detection android app. The .jar is not getting generated. Hence I used the openvino-2023.0-windows-x86_64.jar from dkurt/release git repositories. The .jar requires the libinference_engine_java_api.so internally and the app gets installed and crashes with this fatal error.
Hence I started building the openvino and openvino_contrib for arm cpu , but in vain. The below jar and .so are not getting generated . I have been stuck with this issue for past 2 months.
libopenvino_arm_cpu_plugin.so
libopenvino_gapi_preproc.so
libopenvino_tensorflow_fe.so
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhini123,
Thank you for contacting us.
The creation of the native library file libinference_engine_java_api.so generally occurs on a desktop (or server) environment, not directly within an Android application.
You are using Android Java, which uses Android AAR, and it will produce:
- openvino-android.aar
- libopenvino.so
Regards,
Zul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
Thanks for responding. I shall build openvino on windows environment with the below cmake command
cmake -S %OPV_HOME_DIR%/one-tbb ^
-B %OPV_HOME_DIR%/one-tbb-build ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX=%OPV_HOME_DIR%/one-tbb-install ^
-DCMAKE_TOOLCHAIN_FILE=%CURRENT_CMAKE_TOOLCHAIN_FILE% ^
-DANDROID_ABI=%CURRENT_ANDROID_ABI% ^
-DANDROID_PLATFORM=%CURRENT_ANDROID_PLATFORM% ^
-DANDROID_STL=%CURRENT_ANDROID_STL% ^
-DTBB_TEST=OFF ^
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--undefined-version".
followed by
# Build OneTBB™ project cmake --build $OPV_HOME_DIR/one-tbb-build --parallel # Install OneTBB™ project cmake --install $OPV_HOME_DIR/one-tbb-build
Hope this will generate the jar and libinference_java_api.so
Regards,
Madhini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhini123,
Let us know if you can generate the files.
Regards,
Zul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
Please let me know if I should use openvino/docs/dev/build_windows.md at master · openvinotoolkit/openvino · GitHub or
openvino/docs/dev/build_android.md at master · openvinotoolkit/openvino · GitHub
When i followed the steps build_windows.md , I got the following error
Done Building Project "C:\Users\madhi\Phd\openvino_android\openvino\build\samples\cpp\benchmark\sync_benchmark\ov_sampl
es.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\Users\madhi\Phd\openvino_android\openvino\build\ALL_BUILD.vcxproj" (default targets) -- FAILE
D.
Build FAILED.
"C:\Users\madhi\Phd\openvino_android\openvino\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\madhi\Phd\openvino_android\openvino\build\src\plugins\auto_batch\openvino_auto_batch_plugin.vcxproj" (default
target) (6) ->
"C:\Users\madhi\Phd\openvino_android\openvino\build\src\plugins\auto_batch\openvino_auto_batch_plugin_version.vcxproj"
(default target) (7) ->
"C:\Users\madhi\Phd\openvino_android\openvino\build\src\openvino.vcxproj" (default target) (9) ->
"C:\Users\madhi\Phd\openvino_android\openvino\build\src\common\transformations\openvino_transformations_obj.vcxproj" (d
efault target) (22) ->
(ClCompile target) ->
C:\Users\madhi\Phd\openvino_android\openvino\src\common\transformations\src\transformations\common_optimizations\conv
ert_quantize_dequantize.cpp(146,1): fatal error C1001: Internal compiler error. [C:\Users\madhi\Phd\openvino_android\op
envino\build\src\common\transformations\openvino_transformations_obj.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:18:39.28
Regards,
Madhini B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhini123.
If you want to run OpenVINO on Android system, use build_android.md. This will produce:
- openvino-android-*.aar
- libopenvino.so
If you want to run OpenVINO on Windows, use build_windows.md. This will produce (If Java is enabled in the build):
- openvino.jar
- libinference_engine_java_api.so (for Linux)
- inference_engine_java_api.dll (for Windows)
Regards,
Zul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
In that case, I need the android app on the mobile that I am building in my Windows system to use Openvino. So I will start using the build_android.md . For the ANDROID_ABI , should i have to give x86_64 or arm64-v8a. Could you please confirm
- ANDROID_ABI specifies the target architecture:
- x86_64 for x64 build
- armeabi-v7a with NEON for ARM with NEON support
- arm64-v8a for ARM 64 bits
- riscv64 for RISC-V 64 bits (experimental)
REgards,
Madhini B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhini123.
Most Android devices use ARM-based chips. So I would recommend arm64-v8a.
Regards,
Zul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
I have used the below cmake command and *.aar didnt get generated. I have used a Linux machine for the build . Please let me know if anything is missed out .
libopenvino_auto_plugin.so
libopenvino_c.so
libopenvino_hetero_plugin.so
libopenvino_ir_frontend.so
libopenvino_onnx_frontend.so
libopenvino_paddle_frontend.so
libopenvino_pytorch_frontend.so
libopenvino_tensorflow_frontend.so
libopenvino_tensorflow_lite_frontend.so
libopenvino.so
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhini123,
From your output, we can see that the build is correct. The missing .aar file could be that some step is missing. I'm checking into this and will get back to you.
Regards,
Zul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
I shall await for the response
Regards,
Madhini B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhini123,
My apologies for the misunderstanding. The OpenVINO build process for Android does not generate any .aar files. The process ended properly and generated the following files:
libopenvino_arm_cpu_plugin.so
libopenvino_auto_batch_plugin.so
libopenvino_auto_plugin.so
libopenvino_c.so
libopenvino_genai_c.so
libopenvino_genai.so
libopenvino_hetero_plugin.so
libopenvino_ir_frontend.so
libopenvino_onnx_frontend.so
libopenvino_paddle_frontend.so
libopenvino_pytorch_frontend.so
libopenvino.so
libopenvino_tensorflow_frontend.so
libopenvino_tensorflow_lite_frontend.so
The process is correct, as you generated the required .so files. The difference between the files listed above and yours could be due to different configurations.
Regards,
Zul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
Thanks for the reply. I shall recheck
Currently I have started rebuilding openvino in a linux Debian machine for arm architecture following the demo on github
Instead of java 8 I used java 17 as 8 is not available officially
sudo apt-get install -y openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64git clone --recurse https://github.com/openvinotoolkit/openvino.git "$WORK_DIR/openvino" git clone --recurse https://github.com/openvinotoolkit/openvino_contrib.git "$WORK_DIR/openvino_contrib"
mkdir "$WORK_DIR/android-tools" wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip unzip commandlinetools-linux-7583922_latest.zip yes | ./cmdline-tools/bin/sdkmanager --sdk_root="$WORK_DIR/android-tools" --licenses
./cmdline-tools/bin/sdkmanager --sdk_root="$WORK_DIR/android-tools" --install "ndk-bundle"
mkdir "$WORK_DIR/openvino_build" "$WORK_DIR/openvino_install" cmake -GNinja \ -DVERBOSE_BUILD=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE="$WORK_DIR/android-tools/ndk-bundle/build/cmake/android.toolchain.cmake" \ -DANDROID_ABI=arm64-v8a \ -DANDROID_STL=c++_shared \ -DANDROID_PLATFORM=29 \ -DENABLE_SAMPLES=ON \ -DENABLE_INTEL_MYRIAD=OFF \ -DENABLE_INTEL_MYRIAD_COMMON=OFF \ -DBUILD_java_api=ON \ -DTHREADING=SEQ \ -DIE_EXTRA_MODULES="$WORK_DIR/openvino_contrib/modules" \ -DARM_COMPUTE_SCONS_JOBS=$(nproc) \ -DCMAKE_INSTALL_PREFIX="$WORK_DIR/openvino_install" \ -B "$WORK_DIR/openvino_build" -S "$WORK_DIR/openvino" ninja -C "$WORK_DIR/openvino_build"
I added extra flag -DENABLE_JAVA=ON
-DENABLE_PROTOBUF=ON \
-DENABLE_SYSTEM_PROTOBUF=OFF
The build got the following error .
Mkdir("build/arm64-v8.2-a")
Using compilers:
CC /dev/shm/openvino_android/android-tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
CXX /dev/shm/openvino_android/android-tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
[2344/3336] Building CXX object src/plugins/intel_cpu/thirdparty/onednn/src/cpu/aarch64/CMakeFiles/dnnl_cpu_aarch64.dir/matmul/jit_int8_matmul.cpp.o
FAILED: src/plugins/intel_cpu/thirdparty/onednn/src/cpu/aarch64/CMakeFiles/dnnl_cpu_aarch64.dir/matmul/jit_int8_matmul.cpp.o
/dev/shm/openvino_android/android-tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android29 --gcc-toolchain=/dev/shm/openvino_android/android-tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/dev/shm/openvino_android/android-tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DDNNL_AARCH64=1 -DDNNL_ENABLE_CONCURRENT_EXEC -DDNNL_ENABLE_CPU_ISA_HINTS -DDNNL_ENABLE_MAX_CPU_ISA -DDNNL_USE_ACL -DDNNL_XBYAK_NO_EXCEPTION -DIN_OV_COMPONENT -DOV_BUILD_POSTFIX=\"\" -DOV_NATIVE_PARENT_PROJECT_ROOT_DIR=\"openvino\" -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/dev/shm/openvino_android/openvino_build/src/plugins/intel_cpu/thirdparty/onednn/include -I/dev/shm/openvino_android/openvino/src/plugins/intel_cpu/thirdparty/onednn/include -I/dev/shm/openvino_android/openvino/src/plugins/intel_cpu/thirdparty/ComputeLibrary -I/dev/shm/openvino_android/openvino/src/plugins/intel_cpu/thirdparty/ComputeLibrary/include -I/dev/shm/openvino_android/openvino/src/plugins/intel_cpu/thirdparty/onednn/third_party -I/dev/shm/openvino_android/openvino/src/plugins/intel_cpu/thirdparty/onednn/src -I/dev/shm/openvino_android/openvino/src/common/conditional_compilation/include -I/dev/shm/openvino_android/openvino/src/common/itt/include -I/dev/shm/openvino_android/openvino/src/common/util/include -I/dev/shm/openvino_android/openvino/thirdparty/pugixml/src -Wsuggest-override -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fsigned-char -ffunction-sections -fdata-sections -fdiagnostics-show-option -Wall -Wundef -Wmissing-declarations -Wno-error=deprecated-declarations -Wno-cpp -Wno-error -Wno-undef -Wno-missing-declarations -Wno-macro-redefined -Wno-suggest-override -fvisibility-inlines-hidden -Wall -Wno-unknown-pragmas -fvisibility=internal -Wno-pass-failed -O2 -DNDEBUG -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-all -ffile-prefix-map=/dev/shm/openvino_android/openvino/= -ffile-prefix-map=../openvino/= -Wno-error=deprecated-declarations -Wno-cpp -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++20 -MD -MT src/plugins/intel_cpu/thirdparty/onednn/src/cpu/aarch64/CMakeFiles/dnnl_cpu_aarch64.dir/matmul/jit_int8_matmul.cpp.o -MF src/plugins/intel_cpu/thirdparty/onednn/src/cpu/aarch64/CMakeFiles/dnnl_cpu_aarch64.dir/matmul/jit_int8_matmul.cpp.o.d -o src/plugins/intel_cpu/thirdparty/onednn/src/cpu/aarch64/CMakeFiles/dnnl_cpu_aarch64.dir/matmul/jit_int8_matmul.cpp.o -c /dev/shm/openvino_android/openvino/src/plugins/intel_cpu/thirdparty/onednn/src/cpu/aarch64/matmul/jit_int8_matmul.cpp
/dev/shm/openvino_android/openvino/src/plugins/intel_cpu/thirdparty/onednn/src/cpu/aarch64/matmul/jit_int8_matmul.cpp:28:10: fatal error: 'ranges' file not found
#include <ranges>
^~~~~~~~
1 error generated.
[2349/3336] Building CXX object src/plugins/intel_cpu/thirdparty/onednn/src/cpu/aarch64/CMakeFiles/dnnl_cpu_aarch64.dir/jit_uni_softmax.cpp.o
ninja: build stopped: subcommand failed.
Everytime the build failed in the dnn library
Could you please let me know if anything is wrong.
Regards,
Madhini B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi 四月七月,
I tested the guide from the openvino_contrib GitHub repository for the android_demo, and was able to build OpenVINO without any issues. I suggest you use this as a reference.
Regards,
Zul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
I shall recheck again with the link posted and update the status of the build
Regards,
Madhini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
I gave the commands present in android_demo link . Facing the below error
Currently I am using Google compute engine VM Linux console with the below configuration
The build failed when cmake was invoked with --parallel option.
cmake --build $OPV_HOME_DIR/openvino-build --parallel
Then I again rebuilt it with the options -j2. Got the below error
cmake --build $OPV_HOME_DIR/openvino-build --j2
80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/tensorflow_translators.cpp.o
[ 80%] Building CXX object src/frontends/paddle/src/CMakeFiles/openvino_paddle_frontend.dir/framework.pb.cc.o
[ 80%] Linking CXX shared library /dev/shm/openvino-android/openvino/bin/aarch64/Release/libopenvino_paddle_frontend.so
PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace.
clang++: error: unable to execute command: Bus error
clang++: error: linker command failed due to signal (use -v to see invocation)
gmake[2]: *** [src/frontends/paddle/src/CMakeFiles/openvino_paddle_frontend.dir/build.make:2384: /dev/shm/openvino-android/openvino/bin/aarch64/Release/libopenvino_paddle_frontend.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:4582: src/frontends/paddle/src/CMakeFiles/openvino_paddle_frontend.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/tokenizers_factory.cpp.o
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/trie_tokenizer.cpp.o
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/truncate.cpp.o
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/unigram_tokenizer.cpp.o
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/utf8_validate.cpp.o
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/utils.cpp.o
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/vocab_decoder.cpp.o
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/vocab_encoder.cpp.o
[ 80%] Building CXX object openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/wordpiece_tokenizer.cpp.o
[ 80%] Linking CXX shared library ../../openvino_genai/libopenvino_tokenizers.so
clang++: error: unable to execute command: Bus error
clang++: error: linker command failed due to signal (use -v to see invocation)
gmake[2]: *** [openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/build.make:589: openvino_genai/libopenvino_tokenizers.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:5820: openvino_tokenizers/src/CMakeFiles/openvino_tokenizers.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2
madhini81@instance-20260114-100351:/dev/shm/openvino-android$
Could you please let me know what should be the system configuration needed to run this openvino build as the build is failing with disk write error or bus error
Regards
Madhini B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhini123,
There are no specific system configurations shared in the docs, but I believe these are the basic requirements:
- Operating System: Ubuntu 20.04/22.04/24.04
- RAM: 16GB
- Disk Space: At least 30GB–50GB free (build can take up to 10-20 GB)
I assume that this error is due to the Google Compute Engine VM not having enough space.
Run df -h to check if there is any available space.
Previously, I also faced some issues with the memory usage. The command helps to resolve the issue. See if this command works for you:
cmake --build $OPV_HOME_DIR/openvino-build --parallel 2
Regards,
Zul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zul,
Atlast, I was able to generate libininference_engine_java_api.so along with other .so's . The linux jar also got generated .
The following configuration worked for me . Parallel 2 or just Parallel gave a write error again and the session stopped.
Hard disk - 50 GB
Boot disk source image
ubuntu-minimal-2504-plucky-amd64-v20260114
Boot disk architecture
X86_64
RAM - 64GB
# The below command worked for a successful build.
cmake --build $OPV_HOME_DIR/openvino-build --parallel 4 .
madhini81@instance-20260117-123134:~/openvino-android/openvino/bin/aarch64/Release/lib_created$ ls -lrt
total 1838708
-rwxrwxr-x 1 madhini81 madhini81 2837368 Jan 17 18:02 libinference_engine_java_api.so
-rwxrwxr-x 1 madhini81 madhini81 410425416 Jan 17 18:02 libopenvino.so
-rwxrwxr-x 1 madhini81 madhini81 830500608 Jan 17 18:02 libopenvino_arm_cpu_plugin.so
-rwxrwxr-x 1 madhini81 madhini81 3699168 Jan 17 18:02 libopenvino_auto_batch_plugin.so
-rwxrwxr-x 1 madhini81 madhini81 12247304 Jan 17 18:02 libopenvino_auto_plugin.so
-rwxrwxr-x 1 madhini81 madhini81 4406472 Jan 17 18:02 libopenvino_c.so
-rwxrwxr-x 1 madhini81 madhini81 5243488 Jan 17 18:02 libopenvino_genai_c.so
-rwxrwxr-x 1 madhini81 madhini81 11215664 Jan 17 18:02 libopenvino_hetero_plugin.so
-rwxrwxr-x 1 madhini81 madhini81 8245088 Jan 17 18:02 libopenvino_ir_frontend.so
-rwxrwxr-x 1 madhini81 madhini81 10487728 Jan 17 18:02 libopenvino_jax_frontend.so
-rwxrwxr-x 1 madhini81 madhini81 132213224 Jan 17 18:02 libopenvino_onnx_frontend.so
-rwxrwxr-x 1 madhini81 madhini81 61962080 Jan 17 18:02 libopenvino_paddle_frontend.so
-rwxrwxr-x 1 madhini81 madhini81 79185176 Jan 17 18:02 libopenvino_pytorch_frontend.so
-rwxrwxr-x 1 madhini81 madhini81 1201800 Jan 17 18:02 libopenvino_template_extension.so
-rwxrwxr-x 1 madhini81 madhini81 130241792 Jan 17 18:02 libopenvino_template_plugin.so
-rwxrwxr-x 1 madhini81 madhini81 115499112 Jan 17 18:02 libopenvino_tensorflow_frontend.so
-rwxrwxr-x 1 madhini81 madhini81 41876064 Jan 17 18:02 libopenvino_tensorflow_lite_frontend.so
madhini81@instance-20260117-123134:~/openvino-android/openvino_contrib/modules/java_api/build/libs$ ls -lrt openvino-2025.1-linux-x86_64.jar
-rw-rw-r-- 1 madhini81 madhini81 21315481 Jan 17 17:32 openvino-2025.1-linux-x86_64.jar
This thread can be closed. Thank you Zul for the continued support and guidance.
Regards,
Madhini B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhini123,
I'm glad to hear that the problem is resolved. This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.
Regards,
Zul
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page