From 5963a0ae3dd7e3d1871514d82a413a3562374432 Mon Sep 17 00:00:00 2001 From: Corbin Date: Sun, 11 Jun 2023 19:07:30 -0700 Subject: [PATCH] Nix flake: Build and install libllama.so --- flake.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f3180c841..e8f960bc4 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,10 @@ '' else ""; nativeBuildInputs = with pkgs; [ cmake ]; buildInputs = osSpecific; - cmakeFlags = [ "-DLLAMA_BUILD_SERVER=ON" ] ++ (optionals isM1 [ + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DLLAMA_BUILD_SERVER=ON" + ] ++ (optionals isM1 [ "-DCMAKE_C_FLAGS=-D__ARM_FEATURE_DOTPROD=1" "-DLLAMA_METAL=ON" ]); @@ -45,6 +48,9 @@ echo "#!${llama-python}/bin/python" > $out/bin/convert.py cat ${./convert.py} >> $out/bin/convert.py chmod +x $out/bin/convert.py + + mkdir -p $out/lib/ + mv libllama.so $out/lib/ ''; meta.mainProgram = "llama"; };