Telosnex / fllama

llama.cpp for Flutter
Other
98 stars 11 forks source link

Failed to load dynamic library 'libfllama.so' #10

Open febryituery opened 3 weeks ago

febryituery commented 3 weeks ago

Hi, thank you for sharing this repository. I had a problem when compiling example project

Step to reproduce :

  1. Clone repository
  2. Pub get
  3. Run example

Error : E/flutter (25318): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libfllama.so': dlopen failed: library "libomp.so" not found: needed by /data/app/~~gXGpJvWSaNfBgIp7EG0ShQ==/com.example.fllama_example-VbJ_HQtowaxp9w2OOZQpDg==/base.apk!/lib/arm64-v8a/libfllama.so in namespace clns-4 E/flutter (25318): #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43) E/flutter (25318): #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12) E/flutter (25318): #2 fllamaDylib.<anonymous closure> (package:fllama/fllama_io.dart:24:27) E/flutter (25318): #3 fllamaDylib (package:fllama/fllama_io.dart:30:2) E/flutter (25318): #4 fllamaDylib (package:fllama/fllama_io.dart) E/flutter (25318): #5 fllamaBindings (package:fllama/fllama_io.dart:33:54) E/flutter (25318): #6 fllamaBindings (package:fllama/fllama_io.dart) E/flutter (25318): #7 fllamaChatTemplateGet (package:fllama/fllama_io.dart:46:7) E/flutter (25318): #8 _MyAppState._runInferencePressed (package:fllama_example/main.dart:497:32) E/flutter (25318): #9 _MyAppState.build.<anonymous closure>.<anonymous closure> (package:fllama_example/main.dart:327:25) E/flutter (25318): #10 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1170:21) E/flutter (25318): #11 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:351:24) E/flutter (25318): #12 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:656:11) E/flutter (25318): #13 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:313:5) E/flutter (25318): #14 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:246:7) E/flutter (25318): #15 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:703:9) E/flutter (25318): #16 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12) E/flutter (25318): #17 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9) E/flutter (25318): #18 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633:13) E/flutter (25318): #19 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18) E/flutter (25318): #20 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7) E/flutter (25318): #21 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:501:19) E/flutter (25318): #22 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:481:22) E/flutter (25318): #23 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:450:11) E/flutter (25318): #24 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:426:7) E/flutter (25318): #25 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:389:5) E/flutter (25318): #26 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:336:7) E/flutter (25318): #27 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:305:9) E/flutter (25318): #28 _invoke1 (dart:ui/hooks.dart:328:13) E/flutter (25318): #29 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:442:7) E/flutter (25318): #30 _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31)

Do you know how to resolve this problem? I'm currently using Macbook Pro Intel, and want to compile the project for Android platform. for model, i'm using Phi 2 Thank you

sitatec commented 2 weeks ago

Same problem. Host: MacBook Pro M1 Target: Android Physical device Model: LLAMA 3.2 1B Q4_K_S

ArachnaDigitalLtd commented 2 weeks ago

Exact same problem here as well.

Target: Android Physical Model: Phi-3.5