-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Describe the issue
When attempting to build ONNX Runtime for the Android platform with QNN EP enabled using the shared library build option, the following error occurs. Although the documentation (https://onnxruntime.ai/docs/build/eps.html#qnn) provides an example build command for QNN EP in a shared library configuration, the actual build process produces the error message "Only support Android + QNN builds with QNN EP built as a static library." This raises the question of whether there is an internal requirement for QNN EP to be built as a static library or if there is a discrepancy between the documentation and the build scripts.
Urgency
No response
Target platform
Android
Build script
build.bat --android --config Release --use_qnn --qnn_home C:\Qualcomm\AIStack\QAIRT\2.31.0.250130 --android_sdk_path C:\Users\User\AppData\Local\Android\Sdk --android_ndk_path C:\Users\User\AppData\Local\Android\Sdk\ndk\28.0.13004108 --android_abi arm64-v8a --android_api 34 --cmake_generator Ninja --build_dir build\Android
Error / output
build.bat --android --config Release --use_qnn --qnn_home C:\Qualcomm\AIStack\QAIRT\2.31.0.250130 --android_sdk_path C:\Users\User\AppData\Local\Android\Sdk --android_ndk_
path C:\Users\User\AppData\Local\Android\Sdk\ndk\28.0.13004108 --android_abi arm64-v8a --android_api 34 --cmake_generator Ninja --build_dir build\Android
2025-02-24 17:14:29,509 tools_python_utils [INFO] - flatbuffers module is not installed. parse_config will not be available
2025-02-24 17:14:29,517 build [DEBUG] - Command line arguments:
--build_dir 'C:\Users\User\Downloads\onnxruntime\build\Windows' --android --config Release --use_qnn --qnn_home 'C:\Qualcomm\AIStack\QAIRT\2.31.0.250130' --android_sdk_path 'C:\Users\User\AppData\Local\Android\Sdk' --android_ndk_path 'C:\Users\User\AppData\Local\Android\Sdk\ndk\28.0.13004108' --android_abi arm64-v8a --android_api 34 --cmake_generator Ninja --build_dir 'build\Android'
Namespace(build_dir='build\Android', config=['Release'], update=False, build=False, clean=False, parallel=1, nvcc_threads=-1, test=False, skip_tests=False, compile_no_warning_as_error=False, enable_nvtx_profile=False, enable_memory_profile=False, enable_training=False, enable_training_apis=False, enable_training_ops=False, enable_nccl=False, mpi_home=None, nccl_home=None, use_mpi=False, enable_onnx_tests=False, path_to_protoc_exe=None, fuzz_testing=False, enable_symbolic_shape_infer_tests=False, gen_doc=None, gen_api_doc=False, use_cuda=False, cuda_version=None, cuda_home=None, cudnn_home=None, enable_cuda_line_info=False, enable_cuda_nhwc_ops=False, disable_cuda_nhwc_ops=False, enable_cuda_minimal_build=False, enable_pybind=False, build_wheel=False, wheel_name_suffix=None, skip_keras_test=False, build_csharp=False, build_nuget=False, msbuild_extra_options=None, build_java=False, build_nodejs=False, build_objc=False, build_shared_lib=False, build_apple_framework=False, cmake_extra_defines=None, target=None, x86=False, rv64=False, arm=False, arm64=False, arm64ec=False, buildasx=False, riscv_toolchain_root='', riscv_qemu_path='', msvc_toolset=None, windows_sdk_version=None, android=True, android_abi='arm64-v8a', android_api=34, android_sdk_path='C:\Users\User\AppData\Local\Android\Sdk', android_ndk_path='C:\Users\User\AppData\Local\Android\Sdk\ndk\28.0.13004108', android_cpp_shared=False, android_run_emulator=False, use_gdk=False, gdk_edition='.', gdk_platform='Scarlett', enable_wasm_memory64=False, ios=False, visionos=False, macos=None, apple_sysroot='', ios_toolchain_file='', visionos_toolchain_file='', xcode_code_signing_team_id='', xcode_code_signing_identity='', cmake_generator='Ninja', osx_arch='x86_64', apple_deploy_target=None, enable_address_sanitizer=False, use_binskim_compliant_compile_flags=False, disable_memleak_checker=False, use_vcpkg=False, use_vcpkg_ms_internal_asset_cache=False, build_wasm=False, build_wasm_static_lib=False, emsdk_version='4.0.3', enable_wasm_simd=False, enable_wasm_threads=False, disable_wasm_exception_catching=False, enable_wasm_api_exception_catching=False, enable_wasm_exception_throwing_override=True, wasm_run_tests_in_browser=False, enable_wasm_profiling=False, enable_wasm_debug_info=False, wasm_malloc=None, emscripten_settings=None, use_extensions=False, extensions_overridden_path=None, cmake_path='cmake', ctest_path='ctest', skip_submodule_sync=False, use_mimalloc=False, use_dnnl=False, dnnl_gpu_runtime='', dnnl_opencl_root='', use_openvino=None, dnnl_aarch64_runtime='', dnnl_acl_root='', use_coreml=False, use_webnn=False, use_snpe=False, snpe_root=None, use_nnapi=False, use_vsinpu=False, nnapi_min_api=None, use_jsep=False, use_webgpu=False, use_external_dawn=False, use_qnn='shared_lib', qnn_home='C:\Qualcomm\AIStack\QAIRT\2.31.0.250130', use_rknpu=False, use_preinstalled_eigen=False, eigen_path=None, enable_msinternal=False, use_vitisai=False, use_tensorrt=False, use_tensorrt_builtin_parser=True, use_tensorrt_oss_parser=False, tensorrt_home=None, test_all_timeout='10800', use_migraphx=False, migraphx_home=None, use_full_protobuf=False, enable_pix_capture=False, skip_onnx_tests=False, skip_winml_tests=False, skip_nodejs_tests=False, enable_msvc_static_runtime=False, use_dml=False, dml_path='', use_winml=False, winml_root_namespace_override=None, dml_external_project=False, use_telemetry=False, enable_wcos=False, enable_lto=False, enable_transformers_tool_test=False, use_acl=False, acl_home=None, acl_libs=None, use_armnn=False, armnn_relu=False, armnn_bn=False, armnn_home=None, armnn_libs=None, build_micro_benchmarks=False, minimal_build=None, include_ops_by_config=None, enable_reduced_operator_type_support=False, disable_contrib_ops=False, disable_ml_ops=False, disable_rtti=False, disable_types=[], disable_exceptions=False, rocm_version=None, use_rocm=False, rocm_home=None, code_coverage=False, enable_lazy_tensor=False, ms_experimental=False, enable_external_custom_op_schemas=False, external_graph_transformer_path=None, enable_cuda_profiling=False, use_cann=False, cann_home=None, enable_rocm_profiling=False, use_xnnpack=False, use_avx512=False, use_azure=False, use_cache=False, use_triton_kernel=False, use_lock_free_queue=False, enable_generic_interface=False)
2025-02-24 17:14:29,617 build [DEBUG] - Defaulting to running update, build [and test for native builds].
2025-02-24 17:14:29,624 build [INFO] - Build started
2025-02-24 17:14:29,625 build [INFO] - git submodule sync --recursive
Synchronizing submodule url for 'cmake/external/emsdk'
Synchronizing submodule url for 'cmake/external/libprotobuf-mutator'
Synchronizing submodule url for 'cmake/external/onnx'
Synchronizing submodule url for 'cmake/external/onnx/third_party/pybind11'
2025-02-24 17:14:30,347 build [INFO] - git submodule update --init --recursive
2025-02-24 17:14:31,064 build [INFO] - Generating CMake build tree
2025-02-24 17:14:31,064 build [ERROR] - Only support Android + QNN builds with QNN EP built as a static library.
Visual Studio Version
No response
GCC / Compiler Version
cmake version 4.0.0-rc1 (also tested with version 3.31.5)
ninja 1.12.1