summaryrefslogtreecommitdiff
path: root/sci-misc/llama-cpp
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2026-02-20 19:21:44 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2026-02-20 19:21:44 +0000
commit4d43e6d0cde20a808cf34a8209e13993b4d47514 (patch)
tree7df9fd016def06f13a75f3737f741417835d0b55 /sci-misc/llama-cpp
parentbe88a86dea938e680085db5cc19607753a229a88 (diff)
downloadbaldeagleos-repo-4d43e6d0cde20a808cf34a8209e13993b4d47514.tar.gz
baldeagleos-repo-4d43e6d0cde20a808cf34a8209e13993b4d47514.tar.xz
baldeagleos-repo-4d43e6d0cde20a808cf34a8209e13993b4d47514.zip
Adding metadata
Diffstat (limited to 'sci-misc/llama-cpp')
-rw-r--r--sci-misc/llama-cpp/Manifest2
-rw-r--r--sci-misc/llama-cpp/llama-cpp-0_pre8100.ebuild (renamed from sci-misc/llama-cpp/llama-cpp-0_pre7770.ebuild)74
2 files changed, 53 insertions, 23 deletions
diff --git a/sci-misc/llama-cpp/Manifest b/sci-misc/llama-cpp/Manifest
index 1659db8229c9..44e89bf6bfcb 100644
--- a/sci-misc/llama-cpp/Manifest
+++ b/sci-misc/llama-cpp/Manifest
@@ -3,6 +3,6 @@ DIST llama-cpp-0_pre6710.tar.gz 25894417 BLAKE2B 147f30d76fd49bf18fa0ab9e3e75d0a
DIST llama-cpp-0_pre6980.tar.gz 26431911 BLAKE2B b7d7c0dcdabde01acb816e73bc344564823dd1fc498fb98bf3c611b2d7a964af4d94f7cad533fe675a30685d510829160e392ab0f3bd16f4757a2f3446b8e3ca SHA512 33e63336ad7c0fc653acd409d9314ce3fc3755ed1c03b4806c647b7c80d91b3c883aec6633334555c3855a24276d4975a54c96af91df8d2f818d4dd1dbcbabfb
DIST llama-cpp-0_pre7276.tar.gz 27765814 BLAKE2B d0553ab1dd29c9d93a18c6217aab4553faf09e385a94b90732a537bbcf9bded54d5cda28553543e2c0cc71b6a157bfb80a48405f3f8281c51525757967b33e16 SHA512 3035fe53fea2ca3b0f35e479f4eaec75e38a2ea670600445776cd6fa696fc83ca19eb6dd7cd2ab1da69e78293c62318b5182e6e5b3423ae6c1f00854c5132a4c
DIST llama-cpp-0_pre7611.tar.gz 28622786 BLAKE2B 3c345645c9bcf07d8a513b9e883619b31b5254581f73429d638403758429fd2dfc5f78a22d538e8d88eb6c1be74bf805481af697480727ed750492ddec5c37fe SHA512 c6c4780d7e68adfc385b57c6f7530423f8205bfa283572b0d414d55e143c03307e98676e41ad527c37d7837f831f8ff24be0f7bf59e366ea82f3802cdc946821
-DIST llama-cpp-0_pre7770.tar.gz 28797089 BLAKE2B 0ad614f16c19ff1339571dd90be566ff4ccedfd991dfeb948f0cedc54f8447a3e72e35ac392bb60d5bc8a44d1757be3bea0123eac02b694f5f0a8f2c2b941b6a SHA512 78896fdcf05330bb4b1fd86a985da56882d0166c6f276afda273dca183e4c7365decd5e9630c8d633e065162cbb06d6d8e4fdcf76be9768b238ee5053abaa3aa
DIST llama-cpp-0_pre7836.tar.gz 28813563 BLAKE2B c843c0199b528114c23c58536552e2a7f581fda93364353e8aa38fda99ddb1942c421ad00be4daf86b49a2c311ef89bb6908b8900ca1ffb64df338cbfa11c354 SHA512 161176107de175d9b6fdc1ebfa9fe0cf6fd6968245730f7df7f17c6a179ef111685d0fed5a45031825dc4b07db270887a4307061f9918e375a1c65f261062d9d
DIST llama-cpp-0_pre7924.tar.gz 28899921 BLAKE2B b89c8c170d1c2d52390dfef35a4e0857b4a3aa174077f2fdfa0fbbe1a254c5e6ae9b976bde9f52e42ed3932403aec728b9c415ca44ccd22c061e7e8a1e481526 SHA512 689c73215e795a53be1d0e6a639983aded1ed7bdeb3a261556de3db2cfdc765a7daf4aa142433f5e99a255dc123035a929b57868d3941ddda400a3c2b1db31cb
+DIST llama-cpp-0_pre8100.tar.gz 29031553 BLAKE2B daa0f439391dd9b0b7804b893d060f11c94600dc4347c0f4d86ede376ef951f725d4811c07b729e6e7bb06cab5e7e6aacc5c3a99b8e6e13ff3e7ed2ae5eae288 SHA512 2582732ee28839d940f5feb66640123070eb0a57f0b6c434fcdca85c84ccabccff430b01c5d361b1b936305b8e9fce9886c6038c44d62e084e6ca9a241533821
diff --git a/sci-misc/llama-cpp/llama-cpp-0_pre7770.ebuild b/sci-misc/llama-cpp/llama-cpp-0_pre8100.ebuild
index a81045e6d7d7..ff61000fd086 100644
--- a/sci-misc/llama-cpp/llama-cpp-0_pre7770.ebuild
+++ b/sci-misc/llama-cpp/llama-cpp-0_pre8100.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2025 Gentoo Authors
+# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -7,24 +7,45 @@ ROCM_VERSION="6.3"
inherit cmake cuda rocm linux-info
-if [[ "${PV}" != "9999" ]]; then
- KEYWORDS="~amd64"
- MY_PV="b${PV#0_pre}"
- S="${WORKDIR}/llama.cpp-${MY_PV}"
- SRC_URI="https://github.com/ggml-org/llama.cpp/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
-else
+TINY_LLAMAS_COMMIT="99dd1a73db5a37100bd4ae633f4cfce6560e1567"
+
+DESCRIPTION="Port of Facebook's LLaMA model in C/C++"
+HOMEPAGE="https://github.com/ggml-org/llama.cpp"
+
+if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/ggml-org/llama.cpp.git"
+else
+ MY_PV="b${PV#0_pre}"
+ SRC_URI="https://github.com/ggml-org/llama.cpp/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/llama.cpp-${MY_PV}"
+ KEYWORDS="~amd64"
fi
-DESCRIPTION="Port of Facebook's LLaMA model in C/C++"
-HOMEPAGE="https://github.com/ggml-org/llama.cpp"
+SRC_URI+="
+ examples? (
+ https://huggingface.co/ggml-org/tiny-llamas/resolve/${TINY_LLAMAS_COMMIT}/stories15M-q4_0.gguf
+ -> ggml-org_models_tinyllamas_stories15M-q4_0-${TINY_LLAMAS_COMMIT}.gguf
+ )
+"
LICENSE="MIT"
SLOT="0"
CPU_FLAGS_X86=( avx avx2 f16c )
-IUSE="curl openblas +openmp blis hip cuda opencl vulkan flexiblas"
-REQUIRED_USE="?? ( openblas blis flexiblas )"
+
+# wwma USE explained here: https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md#hip
+IUSE="curl openblas +openmp blis rocm cuda opencl vulkan flexiblas wmma examples"
+
+REQUIRED_USE="
+ ?? (
+ openblas
+ blis
+ flexiblas
+ )
+ wmma? (
+ rocm
+ )
+"
# curl is needed for pulling models from huggingface
# numpy is used by convert_hf_to_gguf.py
@@ -34,8 +55,12 @@ CDEPEND="
openmp? ( llvm-runtimes/openmp:= )
blis? ( sci-libs/blis:= )
flexiblas? ( sci-libs/flexiblas:= )
- hip? ( >=dev-util/hip-6.3:=
- >=sci-libs/hipBLAS-6.3:=
+ rocm? (
+ >=dev-util/hip-${ROCM_VERSION}:=
+ >=sci-libs/hipBLAS-${ROCM_VERSION}:=
+ wmma? (
+ >=sci-libs/rocWMMA-${ROCM_VERSION}:=
+ )
)
cuda? ( dev-util/nvidia-cuda-toolkit:= )
"
@@ -51,37 +76,41 @@ RDEPEND="${CDEPEND}
BDEPEND="media-libs/shaderc"
pkg_setup() {
- if use hip; then
+ if use rocm; then
linux-info_pkg_setup
if linux-info_get_any_version && linux_config_exists; then
if ! linux_chkconfig_present HSA_AMD_SVM; then
ewarn "To use ROCm/HIP, you need to have HSA_AMD_SVM option enabled in your kernel."
fi
fi
-
fi
}
src_prepare() {
use cuda && cuda_src_prepare
-
cmake_src_prepare
+ if use examples; then
+ mkdir -p "${BUILD_DIR}/tinyllamas" || die
+ cp "${DISTDIR}/ggml-org_models_tinyllamas_stories15M-q4_0-${TINY_LLAMAS_COMMIT}.gguf" \
+ "${BUILD_DIR}/tinyllamas/stories15M-q4_0.gguf" || die
+ fi
}
src_configure() {
local mycmakeargs=(
-DLLAMA_BUILD_TESTS=OFF
+ -DLLAMA_BUILD_EXAMPLES=$(usex examples)
-DLLAMA_BUILD_SERVER=ON
-DCMAKE_SKIP_BUILD_RPATH=ON
-DGGML_NATIVE=0 # don't set march
-DGGML_RPC=ON
- -DLLAMA_CURL=$(usex curl ON OFF)
+ -DLLAMA_CURL=$(usex curl)
-DBUILD_NUMBER="1"
-DGENTOO_REMOVE_CMAKE_BLAS_HACK=ON
- -DGGML_CUDA=$(usex cuda ON OFF)
- -DGGML_OPENCL=$(usex opencl ON OFF)
- -DGGML_OPENMP=$(usex openmp ON OFF)
- -DGGML_VULKAN=$(usex vulkan ON OFF)
+ -DGGML_CUDA=$(usex cuda)
+ -DGGML_OPENCL=$(usex opencl)
+ -DGGML_OPENMP=$(usex openmp)
+ -DGGML_VULKAN=$(usex vulkan)
# avoid clashing with whisper.cpp
-DCMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)/llama.cpp"
@@ -113,10 +142,11 @@ src_configure() {
addpredict "/dev/char/"
fi
- if use hip; then
+ if use rocm; then
rocm_use_hipcc
mycmakeargs+=(
-DGGML_HIP=ON -DAMDGPU_TARGETS=$(get_amdgpu_flags)
+ -DGGML_HIP_ROCWMMA_FATTN=$(usex wmma)
)
fi