ggml: Skip backend library linking code when GGML_BACKEND_DL=ON #15094
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@slaren, it appears that #15074 yesterday was incomplete. I overlooked that the ggml CMake package generated requires all backends from configure-time to be installed (eg when building llama.cpp), or otherwise errors out.
This doesn't really make sense in contexts where
GGML_BACKEND_DL=ONis most useful. For example, a user with a GPU will probably install the HIP or the CUDA backend (if shipped as separate packages) but unlikely both.This PR removes this requirement. But is this OK? Can it negatively affect a build result if not all backends are present?
I also wonder though whether it should include a check for t least one CPU backend.
Side note: this PR also includes a small fix for a misplacement of
$GGML_BACKEND_DIRyesterday, it was in the wrongfind_package. This was very weird. I didn't do this manually, I transferred a change from an older branch usingpatch(1)where this was correct. Maybe some heuristic failed.