UbiquitousLearning / mllm

Fast Multimodal LLM on Mobile Devices
https://ubiquitouslearning.github.io/mllm_website
MIT License
394 stars 48 forks source link

CANNOT LINK EXECUTABLE "./demo_fuyu": library "libomp.so" not found: needed by main executable #81

Closed sharmilamani closed 2 months ago

sharmilamani commented 4 months ago

Hi As i followed the steps to build and run on Samsung s24 android device, facing below error

mllm/scripts$ ./run_fuyu.sh ../vocab/fuyu_vocab.mllm: 1 file pushed, 0 skipped. 34.1 MB/s (5854575 bytes in 0.164s) ../bin-arm/demo_fuyu: 1 file pushed, 0 skipped. 2.4 MB/s (35765448 bytes in 14.432s) ../models/fuyu-8b-q4_k.mllm: 1 file pushed, 0 skipped. 07.7 MB/s (5959714207 bytes in 8600.685s) CANNOT LINK EXECUTABLE "./demo_fuyu": library "libomp.so" not found: needed by main executable

can you kindly help in identifying the root cause

yirongjie commented 4 months ago

I would like to reconfirm if you have followed the instructions to build our code on the Linux platform.

export ANDROID_NDK=/path/to/your/ndk
cd scripts
./build_android.sh

Where /path/to/your/ndk is your NDK installation path.

sharmilamani commented 4 months ago

Yes the build is successful.Ndk used is 26.0.1. Demo_fuyu execution is done after build.

yirongjie commented 4 months ago

If you are unable to link to libomp.so, you can take the following steps:

  1. Push libomp.so to Android devices through adb.

    adb push /path/to/your/ndk/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/17/lib/linux/aarch64/libomp.so /data/local/tmp/mllm/bin/libomp.so

    Where /path/to/your/ndk is your NDK installation path. You need to replace /path/to/your/ndk/toolchains/llfm/prebuild/Linux x86_64/lib/clang/17/lib/Linux/arch64/libomp.so with the directory libomp.so in NDK based on the NDK version.

  2. Export libomp.so in the adb shell: export LD_LIBRARY_PATH=/data/local/tmp/mllm/bin. Then run demo_fuyu.

    adb shell "export LD_LIBRARY_PATH=/data/local/tmp/mllm/bin && cd /data/local/tmp/mllm/bin && ./demo_fuyu"