summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/llama-cpp-python
diff options
context:
space:
mode:
authorkirillrdy <kirillrdy@gmail.com>2025-01-29 15:59:47 +1100
committerGitHub <noreply@github.com>2025-01-29 15:59:47 +1100
commit8ad4c35e953f0ea4267c17b330e73e83628b4f65 (patch)
tree26b8eb97cadf6955fdd13ac318425ea84d803dd2 /pkgs/development/python-modules/llama-cpp-python
parent2c7e15d81795e08b156fb64f3c455835d4c5c86e (diff)
parent74942708f6f41920d6c43dd05eb772056afb4263 (diff)
python312Packages.llama-cpp-python: fix linux build (#377484)
Diffstat (limited to 'pkgs/development/python-modules/llama-cpp-python')
-rw-r--r--pkgs/development/python-modules/llama-cpp-python/default.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/llama-cpp-python/default.nix b/pkgs/development/python-modules/llama-cpp-python/default.nix
index 09ee66b8caf0..90e2d9f7d0cb 100644
--- a/pkgs/development/python-modules/llama-cpp-python/default.nix
+++ b/pkgs/development/python-modules/llama-cpp-python/default.nix
@@ -64,7 +64,16 @@ buildPythonPackage rec {
dontUseCmakeConfigure = true;
SKBUILD_CMAKE_ARGS = lib.strings.concatStringsSep ";" (
- lib.optionals cudaSupport [
+ # Set GGML_NATIVE=off. Otherwise, cmake attempts to build with
+ # -march=native* which is either a no-op (if cc-wrapper is able to ignore
+ # it), or an attempt to build a non-reproducible binary.
+ #
+ # This issue was spotted when cmake rules appended feature modifiers to
+ # -mcpu, breaking linux build as follows:
+ #
+ # cc1: error: unknown value ‘native+nodotprod+noi8mm+nosve’ for ‘-mcpu’
+ [ "-DGGML_NATIVE=off" ]
+ ++ lib.optionals cudaSupport [
"-DGGML_CUDA=on"
"-DCUDAToolkit_ROOT=${lib.getDev cudaPackages.cuda_nvcc}"
"-DCMAKE_CUDA_COMPILER=${lib.getExe cudaPackages.cuda_nvcc}"
@@ -132,10 +141,9 @@ buildPythonPackage rec {
homepage = "https://github.com/abetlen/llama-cpp-python";
changelog = "https://github.com/abetlen/llama-cpp-python/blob/v${version}/CHANGELOG.md";
license = lib.licenses.mit;
- maintainers = with lib.maintainers; [ kirillrdy ];
- badPlatforms = [
- # cc1: error: unknown value ‘native+nodotprod+noi8mm+nosve’ for ‘-mcpu’
- "aarch64-linux"
+ maintainers = with lib.maintainers; [
+ booxter
+ kirillrdy
];
};
}