Skip to content

Nix flake: Build and install libllama.so #1811

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

Closed
wants to merge 1 commit into from

Conversation

MostAwesomeDude
Copy link

No description provided.

@MostAwesomeDude
Copy link
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
Copy link
Collaborator

prusnak commented Jun 14, 2023

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
Copy link

mausch commented Sep 6, 2023

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

@prusnak prusnak closed this Sep 6, 2023
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