summary refs log tree commit diff
diff options
context:
space:
mode:
authorannalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com>2023-11-19 06:04:29 +0000
committerJörg Thalheim <Mic92@users.noreply.github.com>2023-11-19 10:25:46 +0100
commit05967f9a2c5b8b7298a31b324064e4fe0f63be9b (patch)
tree6e58ac034193fa4e70397522efe1bb2fcf4e0377
parent2a85706366a87506b542b024bef39ede4d0f91ab (diff)
downloadnixpkgs-05967f9a2c5b8b7298a31b324064e4fe0f63be9b.tar
nixpkgs-05967f9a2c5b8b7298a31b324064e4fe0f63be9b.tar.gz
nixpkgs-05967f9a2c5b8b7298a31b324064e4fe0f63be9b.tar.bz2
nixpkgs-05967f9a2c5b8b7298a31b324064e4fe0f63be9b.tar.lz
nixpkgs-05967f9a2c5b8b7298a31b324064e4fe0f63be9b.tar.xz
nixpkgs-05967f9a2c5b8b7298a31b324064e4fe0f63be9b.tar.zst
nixpkgs-05967f9a2c5b8b7298a31b324064e4fe0f63be9b.zip
llama-cpp: fix build due to openblas update
add patch so build checks for openblas64 module

https://github.com/NixOS/nixpkgs/pull/255443 updated from openblas
0.3.21 -> 0.3.24.  openblas 0.3.22 moved openblas.pc -> openblas64.pc

https://github.com/OpenMathLib/OpenBLAS/issues/3790
-rw-r--r--pkgs/by-name/ll/llama-cpp/package.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/by-name/ll/llama-cpp/package.nix b/pkgs/by-name/ll/llama-cpp/package.nix
index 400e8f0250c..408f83642ba 100644
--- a/pkgs/by-name/ll/llama-cpp/package.nix
+++ b/pkgs/by-name/ll/llama-cpp/package.nix
@@ -2,6 +2,7 @@
 , cmake
 , darwin
 , fetchFromGitHub
+, fetchpatch
 , nix-update-script
 , stdenv
 , symlinkJoin
@@ -46,6 +47,17 @@ stdenv.mkDerivation (finalAttrs: {
     hash = "sha256-TYklPkqwXLt+80FSHBDA2r3xTXlmgqB7sOt2mNnVNso=";
   };
 
+  patches = [
+    # openblas > v0.3.21 64-bit pkg-config file is now named openblas64.pc
+    # can remove when patch is accepted upstream
+    # https://github.com/ggerganov/llama.cpp/pull/4134
+    (fetchpatch {
+      name = "openblas64-pkg-config.patch";
+      url = "https://github.com/ggerganov/llama.cpp/commit/c885cc9f76c00557601b877136191b0f7aadc320.patch";
+      hash = "sha256-GBTxCiNrCazYRvcHwbqVMAALuJ+Svzf5BE7+nkxw064=";
+    })
+  ];
+
   postPatch = ''
     substituteInPlace ./ggml-metal.m \
       --replace '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"