Skip to content

cmake: Add GGML_BACKEND_DIR option#15074

Merged
ckastner merged 2 commits intoggml-org:masterfrom
ckastner:backend-dir
Aug 4, 2025
Merged

cmake: Add GGML_BACKEND_DIR option#15074
ckastner merged 2 commits intoggml-org:masterfrom
ckastner:backend-dir

Conversation

@ckastner
Copy link
Copy Markdown
Collaborator

@ckastner ckastner commented Aug 4, 2025

This can be used by distributions to specify where to look for backends when ggml is built with GGML_BACKEND_DL=ON.

I looked at how a number of other Debian packages solve this, and the pattern always seems to be some form of /usr/lib/<triplet>/<projectname>/backends/, or plugins/ or some variation thereof. With this option, distros can pick whatever fits them best.

This can be used by distributions to specify where to look for backends
when ggml is built with GGML_BACKEND_DL=ON.
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Aug 4, 2025
Comment thread ggml/CMakeLists.txt Outdated
option(GGML_BACKEND_DL "ggml: build backends as dynamic libraries (requires BUILD_SHARED_LIBS)" OFF)
option(BUILD_SHARED_LIBS "ggml: build shared libraries" ${BUILD_SHARED_LIBS_DEFAULT})
option(GGML_BACKEND_DL "ggml: build backends as dynamic libraries (requires BUILD_SHARED_LIBS)" OFF)
set(GGML_BACKEND_DIR "" CACHE PATH "ggml: target directory for dynamic libraries (requires GGML_BACKEND_DL")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(GGML_BACKEND_DIR "" CACHE PATH "ggml: target directory for dynamic libraries (requires GGML_BACKEND_DL")
set(GGML_BACKEND_DIR "" CACHE PATH "ggml: directory to load dynamic backends from (requires GGML_BACKEND_DL)")

@ckastner ckastner merged commit 4161343 into ggml-org:master Aug 4, 2025
45 of 47 checks passed
blime4 referenced this pull request in blime4/llama.cpp Feb 5, 2026
* cmake: Add GGML_BACKEND_DIR option

This can be used by distributions to specify where to look for backends
when ggml is built with GGML_BACKEND_DL=ON.

* Fix phrasing
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* cmake: Add GGML_BACKEND_DIR option

This can be used by distributions to specify where to look for backends
when ggml is built with GGML_BACKEND_DL=ON.

* Fix phrasing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants