llama_cpp_dart icon indicating copy to clipboard operation
llama_cpp_dart copied to clipboard

macOS support?

Open kaevensen opened this issue 1 year ago • 9 comments

Might be a stupid question but it says macOS is supported but I get missing pod spec when trying to build my Flutter project for macOS

kaevensen avatar Dec 20 '24 10:12 kaevensen

same here

ndnam198 avatar Dec 25 '24 10:12 ndnam198

Error: Error running pod install

hazit90 avatar Dec 30 '24 12:12 hazit90

Can you tell me more about the "pod install" issue? I'm currently building the .dylib using scripts in Darwin folder and adding it directly to Xcode as a dependency by dragging it in. I haven't used CocoaPods for this setup.

netdur avatar Dec 30 '24 13:12 netdur

I had an issue when building with the llama_cpp_dart package for a Mac target but testing today I am unable to reproduce the issue. I was missing the podspec in my macOS folder but seems to be resolved for my part now

kaevensen avatar Dec 30 '24 22:12 kaevensen

I have same problem Error: Error running pod install

FahriBilici avatar Jan 11 '25 20:01 FahriBilici

Got it working on macOS. Here are my steps:

git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
mkdir build
cd build
git checkout b4138
cmake .. \
  -DLLAMA_FATAL_WARNINGS=ON \
  -DLLAMA_CURL=ON \
  -DGGML_RPC=ON \
  -DBUILD_SHARED_LIBS=ON \
  -DLLAMA_NATIVE=ON
cmake --build . --config Release -j $(nproc)
cp src/libllama.so ../..

Also keep in mind to set in your code Llama.libraryPath = 'libllama.dylib';.

rekire avatar Jan 26 '25 13:01 rekire

Got it working on macOS. Here are my steps:

git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp mkdir build cd build git checkout b4138 cmake ..
-DLLAMA_FATAL_WARNINGS=ON
-DLLAMA_CURL=ON
-DGGML_RPC=ON
-DBUILD_SHARED_LIBS=ON
-DLLAMA_NATIVE=ON cmake --build . --config Release -j $(nproc) cp src/libllama.so ../.. Also keep in mind to set in your code Llama.libraryPath = 'libllama.dylib';.

didn't work for me, but thanks for posting.

depombo avatar Feb 06 '25 00:02 depombo

I was able to fix it by cloning this repo inside my repo, importing the local folder and creating a macOS podspec file in the macos similar to the one in the ios folder. However then I run into dyld[54195]: Library not loaded: @rpath/libllama.dylib

depombo avatar Feb 06 '25 17:02 depombo

Works fine for me here in November 2025. I believe this issue can be closed, no?

hg0428 avatar Nov 30 '25 18:11 hg0428