package/llama-cpp: new package
PATCH v4 1/1 package/llama-cpp: new package
Add a package for llama.cpp, a C/C++ LLM inference library, used in popular projects like Ollama, RamaLama, and more.
---
This patch adds a package for llama.cpp, an LLM inference library, supporting many popular models, including LLaMa, Gemma, Deepseek, Qwen, and many more.
This library includes tools that can be used for standalone inference, like llama-cli and llama-server, as well as benchmarking, in llama-bench. The library has a variety of software and hardware accelerated backends, but this patch focuses on OpenBLAS and Vulkan support to start.
The patch disables building for z13 due to ggml requiring z14 or higher. Older GCC versions are also problematic, and GCC > v9 is required.
As mentioned in the virglrenderer series, this package was used to test virglrenderer with venus in a nested qemu guest using virtio-gpu.
https://lists.buildroot.org/pipermail/buildroot/2025-June/781395.html
$ utils/test-pkg -c llama-cpp.config -p llama-cpp -C12 -a
arm-aarch64 [ 1/35]: OK
bootlin-aarch64-glibc [ 2/35]: OK
bootlin-arcle-hs38-uclibc [ 3/35]: OK
bootlin-armv5-uclibc [ 4/35]: OK
bootlin-armv7-glibc [ 5/35]: OK
bootlin-armv7-musl [ 6/35]: OK
bootlin-armv7m-uclibc [ 7/35]: SKIPPED
bootlin-m68k-5208-uclibc [ 8/35]: SKIPPED
bootlin-m68k-68040-uclibc [ 9/35]: OK
bootlin-microblazeel-uclibc [10/35]: OK
bootlin-mipsel-uclibc [11/35]: OK
bootlin-mipsel32r6-glibc [12/35]: OK
bootlin-openrisc-uclibc [13/35]: OK
bootlin-powerpc-e500mc-uclibc [14/35]: OK
bootlin-powerpc64le-power8-glibc [15/35]: OK
bootlin-riscv32-glibc [16/35]: OK
bootlin-riscv64-glibc [17/35]: OK
bootlin-riscv64-musl [18/35]: OK
bootlin-s390x-z13-glibc [19/35]: SKIPPED
bootlin-sh4-uclibc [20/35]: OK
bootlin-sparc-uclibc [21/35]: OK
bootlin-sparc64-glibc [22/35]: OK
bootlin-x86-64-glibc [23/35]: OK
bootlin-x86-64-musl [24/35]: OK
bootlin-x86-64-uclibc [25/35]: OK
bootlin-x86-i686-musl [26/35]: OK
bootlin-xtensa-uclibc [27/35]: OK
br-arm-basic [28/35]: SKIPPED
br-arm-full-nothread [29/35]: SKIPPED
br-arm-full-static [30/35]: SKIPPED
br-i386-pentium4-full [31/35]: OK
br-mips64-n64-full [32/35]: SKIPPED
br-mips64r6-el-hf-glibc [33/35]: OK
br-powerpc-603e-basic-cpp [34/35]: SKIPPED
br-powerpc64-power7-glibc [35/35]: OK35 builds, 8 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
---
Changes in v4:
- Bump version to b6865
- Add CPE identifiers [Thomas Perale]
- Update versioning to match CPE [Thomas Perale]
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Bump version to b6854
- Use standard _ARCH_SUPPORTS pattern in Config.in [Julien]
- Remove dependency on !BR2_riscv, as this is fixed
- Replace dependency on !BR2_s390x w/ !BR2_s390x_z13
- Enable builds with uclibc, selecting libexecinfo when needed [Julien]
- Depend on BR2_INSTALL_LIBSTDCPP [Julien]
- Add homepage to config help string [Julien]
- Move comment to end of Config.in and remove condition on glibc/musl [Julien]
- Fix symbol for libcurl [Julien]
- Handle disabling build features which are not selected [Julien]
- Pass ldflags for libexecinfo [Julien]
- Enable building statically using config from project readme
- Link with libatomic when available, fixes bootlin-sparc-uclibc
- Add dependency on toolchain threads, skips br-arm-full-nothread failure
- Add dependency on wchar, skips br-powerpc-603e-basic-cpp failure
- Vulkan support depends on !BR2_ARM_CPU_ARMV5, skips bootlin-armv5-uclibc failure
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Bump version to b6818
- Link to v1: https://lore.kernel.org/r/[email protected]
--- DEVELOPERS | 1 + package/Config.in | 1 + package/llama-cpp/Config.in | 47 +++++++++++++++++++++++++++ package/llama-cpp/llama-cpp.hash | 4 +++ package/llama-cpp/llama-cpp.mk | 70 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+)
DEVELOPERS +1 -0
@@ -1753,6 +1753,7 @@ F: package/at-spi2-core/ F: package/earlyoom/ F: package/gconf/ F: package/libnss/ +F: package/llama-cpp/ F: package/llvm-project/clang/ F: package/llvm-project/lld/ F: package/llvm-project/llvm/
package/Config.in +1 -0
@@ -2290,6 +2290,7 @@ comment "linux-pam plugins" source "package/libpam-tacplus/Config.in" endif source "package/liquid-dsp/Config.in" + source "package/llama-cpp/Config.in" source "package/llvm-project/llvm/Config.in" source "package/lttng-libust/Config.in" source "package/matio/Config.in"
package/llama-cpp/Config.in new file +47 -0
47 lines not on this page · raw message
package/llama-cpp/llama-cpp.hash new file +4 -0
@@ -0,0 +1,4 @@ +# Locally calculated +sha256 c108fadd61d34da6ff2cfdf085821ff03a45acde2245d9eeeba9358482b305c3 b6865.tar.gz +# License +sha256 e562a2ddfaf8280537795ac5ecd34e3012b6582a147ef69ba6a6a5c08c84757d LICENSE
package/llama-cpp/llama-cpp.mk new file +70 -0
70 lines not on this page · raw message
---
base-commit: c555b6565f2747047603dc8022f81b7ea14b4890
change-id: 20251024-llama-cpp-v2-5f37be7f121a
Best regards,
Signature · 6 lines
Joseph Kogut <[email protected]> _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Julien Olivain via buildroot
AppliedHi Joseph,
Quoted 4 lines · Joseph Kogut
Add a package for llama.cpp, a C/C++ LLM inference library, used in popular projects like Ollama, RamaLama, and more.
Signed-off-by Joseph Kogut <[email protected]>
I applied this patch to master.
I did two minor changes, see:
https://gitlab.com/buildroot.org/buildroot/-/commit/03f35bc63ba01ede5e78900cd98e5217b7e8d70b
I was not sure about the real value of supporting a musl static build with such a package... If we see in autobuilders those static builds are a source of build failures which are complex to fix, we could limit to shared libraries later...
I also wrote a runtime test for that package. If you want to review or test it:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
Best regards,
Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Julien,
Quoted 11 lines · Julien Olivain
Hi Joseph,
Quoted 4 lines · Joseph Kogut
Add a package for llama.cpp, a C/C++ LLM inference library, used in popular projects like Ollama, RamaLama, and more.
Signed-off-by Joseph Kogut <[email protected]>I applied this patch to master.
Quoted 8 lines
I did two minor changes, see:
https://gitlab.com/buildroot.org/buildroot/-/commit/03f35bc63ba01ede5e78900cd98e5217b7e8d70bI was not sure about the real value of supporting a musl static build with such a package... If we see in autobuilders those static builds are a source of build failures which are complex to fix, we could limit to shared libraries later...
Looks good, thanks for your support and reviews!
Quoted 4 lines
I also wrote a runtime test for that package. If you want to review or test it:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
This is great, I'll test and follow up on that patch.
Quoted 3 lines
Best regards,
Julien.
Best,
Joseph
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot