Skip to content

Commit

Permalink
python312Packages.llama-cpp-python: fix linux build (#377484)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillrdy authored Jan 29, 2025
2 parents 2c7e15d + 7494270 commit 8ad4c35
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions pkgs/development/python-modules/llama-cpp-python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
];
};
}

0 comments on commit 8ad4c35

Please sign in to comment.