Skip to content

CMake: add relocatable Llama package - #2960

Merged
ggerganov merged 11 commits into
ggml-org:masterfrom
mtmcp:cmake-find-package
Sep 14, 2023
Merged

ggerganov merged 11 commits into
ggml-org:masterfrom
mtmcp:cmake-find-package

Conversation

@mtmcp

@mtmcp mtmcp commented Sep 1, 2023

Copy link
Copy Markdown
Collaborator

This change adds support for a relocatable CMake package. This includes several enhancements:

  1. When building/installing llama.cpp with CMake, a cmake package is generated and added to lib/cmake/Llama. This generates the required LlamaConfig.cmake and LlamaConfigVersion.cmake files.
  2. An example application, examples/main-cmake-pkg, for testing/demonstrating these capabilities. This application builds main but using the installed Llama CMake package.

This will enable application developers using CMake a much improved way to add llama as a link target.

@staviq

staviq commented Sep 1, 2023

Copy link
Copy Markdown
Contributor

Take a look at #2886, it's possibly related.

@mtmcp

mtmcp commented Sep 1, 2023

Copy link
Copy Markdown
Collaborator Author

Take a look at #2886, it's possibly related.

These do not (to me at least) seem to be related. The change I have made builds a Llama CMake package, whereas #2886 allows make (not CMake) to override flags.

@mtmcp

mtmcp commented Sep 11, 2023

Copy link
Copy Markdown
Collaborator Author

Anyone can merge this please? Thank you!

@ggerganov
ggerganov merged commit 990a5e2 into ggml-org:master Sep 14, 2023
@mtmcp
mtmcp deleted the cmake-find-package branch September 15, 2023 01:00
pkrmf pushed a commit to morlockstudios-com/llama.cpp that referenced this pull request Sep 26, 2023
* Keep static libs and headers with install

* Add logic to generate Config package

* Use proper build info

* Add llama as import library

* Prefix target with package name

* Add example project using CMake package

* Update README

* Update README

* Remove trailing whitespace
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* Keep static libs and headers with install

* Add logic to generate Config package

* Use proper build info

* Add llama as import library

* Prefix target with package name

* Add example project using CMake package

* Update README

* Update README

* Remove trailing whitespace
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
* Keep static libs and headers with install

* Add logic to generate Config package

* Use proper build info

* Add llama as import library

* Prefix target with package name

* Add example project using CMake package

* Update README

* Update README

* Remove trailing whitespace
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* Keep static libs and headers with install

* Add logic to generate Config package

* Use proper build info

* Add llama as import library

* Prefix target with package name

* Add example project using CMake package

* Update README

* Update README

* Remove trailing whitespace
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* Keep static libs and headers with install

* Add logic to generate Config package

* Use proper build info

* Add llama as import library

* Prefix target with package name

* Add example project using CMake package

* Update README

* Update README

* Remove trailing whitespace
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* Keep static libs and headers with install

* Add logic to generate Config package

* Use proper build info

* Add llama as import library

* Prefix target with package name

* Add example project using CMake package

* Update README

* Update README

* Remove trailing whitespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants