Skip to content

Nix flake: Build and install libllama.so - #1811

Closed
MostAwesomeDude wants to merge 1 commit into
ggml-org:masterfrom
MostAwesomeDude:master
Closed

MostAwesomeDude wants to merge 1 commit into
ggml-org:masterfrom
MostAwesomeDude:master

Conversation

@MostAwesomeDude

Copy link
Copy Markdown

No description provided.

@MostAwesomeDude

Copy link
Copy Markdown
Author

Can this get CI soon? I know that it'll require somebody who can read Nix to properly review. But for now, it shouldn't cause a build regression, since CI doesn't build the flake.

@prusnak

prusnak commented Jun 14, 2023 •

Copy link
Copy Markdown
Contributor

This does not work on macOS.

You need this fix:

-mv libllama.so $out/lib/
+mv libllama${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/

and even with the change I see this error when I run nix run:

dyld[3847]: Library not loaded: @rpath/libllama.dylib
  Referenced from: <no uuid> /nix/store/whkvpbi1zgw0fj1nvkp3mw4cchpl431a-llama.cpp/bin/llama

Does nix run run on Linux? It seems to me that $out/bin/llama is looking for $out/bin/liblama.so (or $out/bin/liblama.dylib on macOS) and this is not found, since it is in $out/lib.

@mausch

mausch commented Sep 6, 2023

Copy link
Copy Markdown

FWIW this works fine for me on Linux already.

$ nix build github:ggerganov/llama.cpp
$ ls -1 result/lib
libembdinput.so
libggml_shared.so
libllama.so

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

Successfully merging this pull request may close these issues.

3 participants