llama-cpp: assert that only one of the *Support arguments is true

When experimenting with llama-cpp I experienced a mysterious build
error that in the end I tracked down to me setting openclSupport and
openblasSupport to true.  To prevent others from this mistake add an
assert that complains if more than one of the arguments openclSupport,
openblasSupport and rocmSupport is set to true.
This commit is contained in:
Kai Harries
2023-12-22 09:00:32 +01:00
parent 20a9e5cfe9
commit ded8563fb3
+4
View File
@@ -22,6 +22,10 @@
, pkg-config
}:
assert lib.assertMsg
(lib.count lib.id [openclSupport openblasSupport rocmSupport] == 1)
"llama-cpp: exactly one of openclSupport, openblasSupport and rocmSupport should be enabled";
let
cudatoolkit_joined = symlinkJoin {
name = "${cudaPackages.cudatoolkit.name}-merged";