Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not find clog #288

Closed
tkkcc opened this issue Sep 25, 2024 · 1 comment
Closed

could not find clog #288

tkkcc opened this issue Sep 25, 2024 · 1 comment

Comments

@tkkcc
Copy link

tkkcc commented Sep 25, 2024

Hi, i am trying to use ort on android arm64

i build onnxruntime v1.19.2 with following command

./build.sh --android --android_sdk_path ~/Android/Sdk --android_ndk_path ~/Android/Sdk/ndk/27.0.11718014 --android_abi arm64-v8a --android_api 24 --config Release --parallel --use_nnapi --use_xnnpack --build_java

then i set ORT_LIB_LOCATION env before cargo ndk build. ort-sys fail on println!("cargo:rustc-link-lib=static=clog");

i searched but can't find clog artifacts

~/b/onnxruntime fd clog -uuuu                                                                                                                        
build/Android/Release/_deps/pytorch_cpuinfo-src/deps/clog/
build/Android/Release/_deps/pytorch_cpuinfo-src/deps/clog/include/clog.h
build/Android/Release/_deps/pytorch_cpuinfo-src/deps/clog/src/clog.c
build/Android/Release/_deps/pytorch_cpuinfo-src/deps/clog/test/clog.cc
onnxruntime/core/common/logging/sinks/clog_sink.h

after commenting out this link, it compiles.

but at runtime, i got this error on load

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNSt6__ndk119__shared_weak_countD2Ev"

the ort code is only

    use ort::{GraphOptimizationLevel, Session};
    let model = Session::builder();

is my bulid command wrong (°ー°〃), thanks

tkkcc added a commit to tkkcc/gamebot that referenced this issue Sep 25, 2024
@decahedron1
Copy link
Member

clog issue fixed in 2502224.

I am not familiar with Android, but from similar issues I've found online, it seems the dlopen error is caused by a mismatched API version, and may be resolved by packaging libc++_shared.so with the APK, and explicitly loading that library before loading your Rust library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants