Skip to content

Commit

Permalink
sci-misc/llama-cpp: add dependencies on curl and numpy
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Korepanov <[email protected]>
  • Loading branch information
khumarahn committed Feb 8, 2025
1 parent 61c3aad commit fb105c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sci-misc/llama-cpp/llama-cpp-0_pre4576.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,22 @@ HOMEPAGE="https://github.com/ggerganov/llama.cpp"
LICENSE="MIT"
SLOT="0"
CPU_FLAGS_X86=( avx avx2 f16c )
IUSE="curl"

# curl is needed for pulling models from huggingface
# numpy is used by convert_hf_to_gguf.py
DEPEND="curl? ( net-misc/curl:= )"
RDEPEND="${DEPEND}
dev-python/numpy
"

src_configure() {
local mycmakeargs=(
-DLLAMA_BUILD_TESTS=OFF
-DLLAMA_BUILD_SERVER=ON
-DCMAKE_SKIP_BUILD_RPATH=ON
-DGGML_NATIVE=0 # don't set march
-DLLAMA_CURL=$(usex curl ON OFF)
-DBUILD_NUMBER="1"
)
cmake_src_configure
Expand Down
9 changes: 9 additions & 0 deletions sci-misc/llama-cpp/llama-cpp-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,22 @@ HOMEPAGE="https://github.com/ggerganov/llama.cpp"
LICENSE="MIT"
SLOT="0"
CPU_FLAGS_X86=( avx avx2 f16c )
IUSE="curl"

# curl is needed for pulling models from huggingface
# numpy is used by convert_hf_to_gguf.py
DEPEND="curl? ( net-misc/curl:= )"

This comment has been minimized.

Copy link
@stkw0

stkw0 Feb 8, 2025

Contributor

Does it call curl at compile phase to download something or it calls curl as part of running the program? In the first case it would break the sandbox and it would be better to find an alternative approach (adding this models to SRC_URI for example).

This comment has been minimized.

Copy link
@khumarahn

khumarahn Feb 9, 2025

Author Contributor

No, I don't think it calls curl at compile time. This enables downloading models from huggingface.

This comment has been minimized.

Copy link
@khumarahn

khumarahn Feb 9, 2025

Author Contributor

The models are huge files, tens of GB

This comment has been minimized.

Copy link
@stkw0

stkw0 Feb 9, 2025

Contributor

In this case, shouldn't it be a run time dependency (RDEPEND)?

This comment has been minimized.

Copy link
@khumarahn

khumarahn Feb 9, 2025

Author Contributor

It links against curl

This comment has been minimized.

Copy link
@stkw0

stkw0 Feb 9, 2025

Contributor

I see. Thanks :)

RDEPEND="${DEPEND}
dev-python/numpy
"

src_configure() {
local mycmakeargs=(
-DLLAMA_BUILD_TESTS=OFF
-DLLAMA_BUILD_SERVER=ON
-DCMAKE_SKIP_BUILD_RPATH=ON
-DGGML_NATIVE=0 # don't set march
-DLLAMA_CURL=$(usex curl ON OFF)
-DBUILD_NUMBER="1"
)
cmake_src_configure
Expand Down

0 comments on commit fb105c9

Please sign in to comment.