Commit 05967f9a authored by annalee's avatar annalee Committed by Jörg Thalheim
Browse files

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
parent 2a857063
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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\";"