sci-misc/llama-cpp: handle automagic openmp dep

enabled by default as otherwise results in severe performance hit
see https://github.com/ggml-org/llama.cpp/issues/12171

Signed-off-by: Sergey Alirzaev <l29ah@riseup.net>
This commit is contained in:
Sergey Alirzaev
2025-08-10 02:35:22 +02:00
parent 91cadfe3eb
commit 3733474f9c
2 changed files with 6 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ HOMEPAGE="https://github.com/ggml-org/llama.cpp"
LICENSE="MIT"
SLOT="0"
CPU_FLAGS_X86=( avx avx2 f16c )
IUSE="curl openblas blis hip cuda opencl vulkan"
IUSE="curl openblas +openmp blis hip cuda opencl vulkan"
REQUIRED_USE="?? ( openblas blis )"
# curl is needed for pulling models from huggingface
@@ -31,6 +31,7 @@ REQUIRED_USE="?? ( openblas blis )"
CDEPEND="
curl? ( net-misc/curl:= )
openblas? ( sci-libs/openblas:= )
openmp? ( llvm-runtimes/openmp:= )
blis? ( sci-libs/blis:= )
hip? ( >=dev-util/hip-6.3:=
>=sci-libs/hipBLAS-6.3:=
@@ -77,6 +78,7 @@ src_configure() {
-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)
# avoid clashing with whisper.cpp

View File

@@ -23,7 +23,7 @@ HOMEPAGE="https://github.com/ggml-org/llama.cpp"
LICENSE="MIT"
SLOT="0"
CPU_FLAGS_X86=( avx avx2 f16c )
IUSE="curl openblas blis hip cuda opencl vulkan"
IUSE="curl openblas +openmp blis hip cuda opencl vulkan"
REQUIRED_USE="?? ( openblas blis )"
# curl is needed for pulling models from huggingface
@@ -31,6 +31,7 @@ REQUIRED_USE="?? ( openblas blis )"
CDEPEND="
curl? ( net-misc/curl:= )
openblas? ( sci-libs/openblas:= )
openmp? ( llvm-runtimes/openmp:= )
blis? ( sci-libs/blis:= )
hip? ( >=dev-util/hip-6.3:=
>=sci-libs/hipBLAS-6.3:=
@@ -77,6 +78,7 @@ src_configure() {
-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)
# avoid clashing with whisper.cpp