public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:dev commit in: app-misc/ollama/
@ 2024-09-19 11:27 Ivan Lloro
  0 siblings, 0 replies; 6+ messages in thread
From: Ivan Lloro @ 2024-09-19 11:27 UTC (permalink / raw
  To: gentoo-commits

commit:     9be74c9532e61b6673bb539b8e45fc1023c62559
Author:     Ivan Lloro <ivan.lloro.boada <AT> gmail <DOT> com>
AuthorDate: Thu Sep 19 11:27:08 2024 +0000
Commit:     Ivan Lloro <ivan.lloro.boada <AT> gmail <DOT> com>
CommitDate: Thu Sep 19 11:27:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=9be74c95

app-misc/ollama: Add missing keyword for AMD64

Signed-off-by: Ivan Lloro <ivan.lloro.boada <AT> gmail.com>

 app-misc/ollama/ollama-9999.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app-misc/ollama/ollama-9999.ebuild b/app-misc/ollama/ollama-9999.ebuild
index ded584254..e78c85451 100644
--- a/app-misc/ollama/ollama-9999.ebuild
+++ b/app-misc/ollama/ollama-9999.ebuild
@@ -10,6 +10,7 @@ HOMEPAGE="https://ollama.com"
 EGIT_REPO_URI="https://github.com/ollama/ollama.git"
 LICENSE="MIT"
 SLOT="0"
+KEYWORDS="~amd64"
 
 IUSE="nvidia amd"
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-misc/ollama/
@ 2024-09-19 11:58 Anna Vyalkova
  0 siblings, 0 replies; 6+ messages in thread
From: Anna Vyalkova @ 2024-09-19 11:58 UTC (permalink / raw
  To: gentoo-commits

commit:     6df145813b847f86037fef1602d03752947e5bf4
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Thu Sep 19 11:58:14 2024 +0000
Commit:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Thu Sep 19 11:58:14 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=6df14581

Revert "app-misc/ollama: Add missing keyword for AMD64"

No keywords on live ebuilds.

This reverts commit 9be74c9532e61b6673bb539b8e45fc1023c62559.

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 app-misc/ollama/ollama-9999.ebuild | 1 -
 1 file changed, 1 deletion(-)

diff --git a/app-misc/ollama/ollama-9999.ebuild b/app-misc/ollama/ollama-9999.ebuild
index e78c85451..ded584254 100644
--- a/app-misc/ollama/ollama-9999.ebuild
+++ b/app-misc/ollama/ollama-9999.ebuild
@@ -10,7 +10,6 @@ HOMEPAGE="https://ollama.com"
 EGIT_REPO_URI="https://github.com/ollama/ollama.git"
 LICENSE="MIT"
 SLOT="0"
-KEYWORDS="~amd64"
 
 IUSE="nvidia amd"
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-misc/ollama/
@ 2024-12-12 19:36 Eric Joldasov
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Joldasov @ 2024-12-12 19:36 UTC (permalink / raw
  To: gentoo-commits

commit:     2289aca2d83518a11721ead426e4142f7600b6de
Author:     Eric Joldasov <bratishkaerik <AT> landless-city <DOT> net>
AuthorDate: Thu Dec 12 19:34:04 2024 +0000
Commit:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
CommitDate: Thu Dec 12 19:34:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2289aca2

app-misc/ollama: bump minimum Go version to 1.23.4

Fixes this error:

```
go mod vendor
go: go.mod requires go >= 1.23.4 (running go 1.23.3; GOTOOLCHAIN=local)
 * ERROR: app-misc/ollama-9999::guru failed (unpack phase):
 *   go mod vendor failed
```

Signed-off-by: Eric Joldasov <bratishkaerik <AT> landless-city.net>

 app-misc/ollama/ollama-9999.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app-misc/ollama/ollama-9999.ebuild b/app-misc/ollama/ollama-9999.ebuild
index ded584254..c45ce6165 100644
--- a/app-misc/ollama/ollama-9999.ebuild
+++ b/app-misc/ollama/ollama-9999.ebuild
@@ -19,7 +19,7 @@ RDEPEND="
 "
 IDEPEND="${RDEPEND}"
 BDEPEND="
-	>=dev-lang/go-1.21.0
+	>=dev-lang/go-1.23.4
 	>=dev-build/cmake-3.24
 	>=sys-devel/gcc-11.4.0
 	nvidia? ( dev-util/nvidia-cuda-toolkit )


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-misc/ollama/
@ 2025-01-26  9:04 Yahor Berdnikau
  0 siblings, 0 replies; 6+ messages in thread
From: Yahor Berdnikau @ 2025-01-26  9:04 UTC (permalink / raw
  To: gentoo-commits

commit:     ac646f42de00d0fcada1326f887692fedef16879
Author:     Yahor Berdnikau <egorr.berd <AT> gmail <DOT> com>
AuthorDate: Sun Jan 26 09:02:59 2025 +0000
Commit:     Yahor Berdnikau <egorr.berd <AT> gmail <DOT> com>
CommitDate: Sun Jan 26 09:02:59 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ac646f42

app-misc/ollama: Fixes build due to the upstream build system changes

Bug: https://bugs.gentoo.org/946268
Signed-off-by: Yahor Berdnikau <egorr.berd <AT> gmail.com>

 app-misc/ollama/metadata.xml       |  3 +-
 app-misc/ollama/ollama-9999.ebuild | 76 +++++++++++++++++++++++++++++---------
 2 files changed, 60 insertions(+), 19 deletions(-)

diff --git a/app-misc/ollama/metadata.xml b/app-misc/ollama/metadata.xml
index 352043225..4ebf01228 100644
--- a/app-misc/ollama/metadata.xml
+++ b/app-misc/ollama/metadata.xml
@@ -7,8 +7,7 @@
 		<description>A copy from https://github.com/MrPenguin07/ebuilds/tree/master/dev-ml/ollama</description>
 	</maintainer>
 	<use>
-		<flag name="nvidia">Add support of nvidia</flag>
-		<flag name="amd">Add support of amd</flag>
+		<flag name="cuda">Enable NVIDIA CUDA support</flag>
 	</use>
 	<upstream>
 		<remote-id type="github">ollama/ollama</remote-id>

diff --git a/app-misc/ollama/ollama-9999.ebuild b/app-misc/ollama/ollama-9999.ebuild
index c45ce6165..f0d2f0be2 100644
--- a/app-misc/ollama/ollama-9999.ebuild
+++ b/app-misc/ollama/ollama-9999.ebuild
@@ -1,9 +1,10 @@
-# Copyright 2024 Gentoo Authors
+# Copyright 2024-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-inherit git-r3 go-module
+ROCM_VERSION=6.1
+inherit git-r3 go-module rocm
 
 DESCRIPTION="Get up and running with Llama 3, Mistral, Gemma, and other language models."
 HOMEPAGE="https://ollama.com"
@@ -11,7 +12,18 @@ EGIT_REPO_URI="https://github.com/ollama/ollama.git"
 LICENSE="MIT"
 SLOT="0"
 
-IUSE="nvidia amd"
+IUSE="cuda video_cards_amdgpu
+cpu_flags_x86_avx cpu_flags_x86_avx2
+cpu_flags_x86_avx512f cpu_flags_x86_avx512vbmi cpu_flags_x86_avx512_vnni cpu_flags_x86_avx512_bf16
+"
+
+REQUIRED_USE="
+	cpu_flags_x86_avx2? ( cpu_flags_x86_avx )
+	cpu_flags_x86_avx512f? ( cpu_flags_x86_avx2 )
+	cpu_flags_x86_avx512vbmi? ( cpu_flags_x86_avx512f )
+	cpu_flags_x86_avx512_vnni? ( cpu_flags_x86_avx512f )
+	cpu_flags_x86_avx512_bf16? ( cpu_flags_x86_avx512f )
+"
 
 RDEPEND="
 	acct-group/ollama
@@ -22,15 +34,14 @@ BDEPEND="
 	>=dev-lang/go-1.23.4
 	>=dev-build/cmake-3.24
 	>=sys-devel/gcc-11.4.0
-	nvidia? ( dev-util/nvidia-cuda-toolkit )
-	amd? (
-		sci-libs/clblast
-		dev-libs/rocm-opencl-runtime
+	cuda? ( dev-util/nvidia-cuda-toolkit )
+	video_cards_amdgpu? (
+		=sci-libs/hipBLAS-${ROCM_VERSION}*
 	)
 "
 
 pkg_pretend() {
-	if use amd; then
+	if use video_cards_amdgpu || use cuda; then
 		ewarn "WARNING: AMD & Nvidia support in this ebuild are experimental"
 		einfo "If you run into issues, especially compiling dev-libs/rocm-opencl-runtime"
 		einfo "you may try the docker image here https://github.com/ROCm/ROCm-docker"
@@ -44,20 +55,51 @@ src_unpack() {
 	go-module_live_vendor
 }
 
+src_prepare() {
+	default
+
+	if use video_cards_amdgpu; then
+		# --hip-version gets appended to the compile flags which isn't a known flag.
+		# This causes rocm builds to fail because -Wunused-command-line-argument is turned on.
+		# Use nuclear option to fix this.
+		# Disable -Werror's from go modules.
+		find "${S}" -name ".go" -exec sed -i "s/ -Werror / /g" {} + || die
+	fi
+}
+
 src_compile() {
-	VERSION=$(
-		git describe --tags --first-parent --abbrev=7 --long --dirty --always \
-		| sed -e "s/^v//g"
-		assert
-	)
-	export GOFLAGS="'-ldflags=-w -s \"-X=github.com/ollama/ollama/version.Version=${VERSION}\"'"
+	CUSTOM_CPU_FLAGS=""
+	use cpu_flags_x86_avx && CUSTOM_CPU_FLAGS+="avx"
+	use cpu_flags_x86_avx2 && CUSTOM_CPU_FLAGS+=",avx2"
+	use cpu_flags_x86_avx512f && CUSTOM_CPU_FLAGS+=",avx512"
+	use cpu_flags_x86_avx512vbmi && CUSTOM_CPU_FLAGS+=",avx512vbmi"
+	use cpu_flags_x86_avx512_vnni && CUSTOM_CPU_FLAGS+=",avx512vnni"
+	use cpu_flags_x86_avx512_bf16 && CUSTOM_CPU_FLAGS+=",avx512bf16"
 
-	ego generate ./...
-	ego build .
+	# Build basic ollama executable with cpu features built in
+	export CUSTOM_CPU_FLAGS
+
+	if use video_cards_amdgpu; then
+		export HIP_ARCHS=$(get_amdgpu_flags)
+		export HIP_PATH="/usr"
+	else
+		export OLLAMA_SKIP_ROCM_GENERATE=1
+	fi
+
+	if ! use cuda; then
+		export OLLAMA_SKIP_CUDA_GENERATE=1
+	fi
+	emake dist
 }
 
 src_install() {
-	dobin ollama
+	dobin dist/linux-${ARCH}/bin/ollama
+
+	if [[ -d "dist/linux-${ARCH}/lib/ollama" ]] ; then
+		insinto /usr/lib
+		doins -r dist/linux-${ARCH}/lib/ollama
+	fi
+
 	doinitd "${FILESDIR}"/ollama
 }
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-misc/ollama/
@ 2025-01-31 18:41 Yahor Berdnikau
  0 siblings, 0 replies; 6+ messages in thread
From: Yahor Berdnikau @ 2025-01-31 18:41 UTC (permalink / raw
  To: gentoo-commits

commit:     bfaa93dcace907596bee18483e11f9831f5d6cf9
Author:     Yahor Berdnikau <egorr.berd <AT> gmail <DOT> com>
AuthorDate: Fri Jan 31 18:40:07 2025 +0000
Commit:     Yahor Berdnikau <egorr.berd <AT> gmail <DOT> com>
CommitDate: Fri Jan 31 18:40:59 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=bfaa93dc

app-misc/ollama: add 0.5.7

Bug: https://bugs.gentoo.org/946268
Signed-off-by: Yahor Berdnikau <egorr.berd <AT> gmail.com>

 app-misc/ollama/Manifest            |   2 +
 app-misc/ollama/ollama-0.5.7.ebuild | 113 ++++++++++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+)

diff --git a/app-misc/ollama/Manifest b/app-misc/ollama/Manifest
new file mode 100644
index 000000000..0d00a5bb0
--- /dev/null
+++ b/app-misc/ollama/Manifest
@@ -0,0 +1,2 @@
+DIST ollama-0.5.7-deps.tar.xz 115361652 BLAKE2B 8694b35ef2545481c2e1f6a9d7c462177f25e78aab79288197ec4b33190a905c7e92e54734725cde7f122e1161cbdaf9c72ae40cbeb0b8ee0af9075e3dbb6691 SHA512 d7abe6266120cb9e731e53f6e14e16d8991e76fbab06348de945f53dc407788324b850308e7200616d92dd17a417ad0a2491eddd543bbe2cfee6a66c8ab81840
+DIST ollama-0.5.7.gh.tar.gz 2345089 BLAKE2B 7d5063e9f665ab2a957d449b38017e6a9bb435c938749161c711cfc35d8a0361e7f4db214e0782f3b51c70c909fc5be8b76ca342cda6163b5aca5fdd733c55d9 SHA512 ea8adcec4f8f932c422a400b8cafb4b983bfa0721cd14383ceb8e0a4f588ecd1289d2e1de46a916c1b34d13e5dab2825ef11a37fc3e797345348dea3bd9144fe

diff --git a/app-misc/ollama/ollama-0.5.7.ebuild b/app-misc/ollama/ollama-0.5.7.ebuild
new file mode 100644
index 000000000..408c054e1
--- /dev/null
+++ b/app-misc/ollama/ollama-0.5.7.ebuild
@@ -0,0 +1,113 @@
+# Copyright 2024-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ROCM_VERSION=6.1
+inherit go-module rocm
+
+DESCRIPTION="Get up and running with Llama 3, Mistral, Gemma, and other language models."
+HOMEPAGE="https://ollama.com"
+SRC_URI="https://github.com/ollama/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
+SRC_URI+=" https://github.com/Tapchicoma/ebuild-deps/raw/refs/heads/main/go-deps/${PN}-${PV}-deps.tar.xz"
+S="${WORKDIR}/${PN}-${PV}"
+LICENSE="MIT"
+SLOT="0"
+
+IUSE="cuda video_cards_amdgpu
+cpu_flags_x86_avx cpu_flags_x86_avx2
+cpu_flags_x86_avx512f cpu_flags_x86_avx512vbmi cpu_flags_x86_avx512_vnni cpu_flags_x86_avx512_bf16
+"
+
+REQUIRED_USE="
+	cpu_flags_x86_avx2? ( cpu_flags_x86_avx )
+	cpu_flags_x86_avx512f? ( cpu_flags_x86_avx2 )
+	cpu_flags_x86_avx512vbmi? ( cpu_flags_x86_avx512f )
+	cpu_flags_x86_avx512_vnni? ( cpu_flags_x86_avx512f )
+	cpu_flags_x86_avx512_bf16? ( cpu_flags_x86_avx512f )
+"
+
+RDEPEND="
+	acct-group/ollama
+	acct-user/ollama
+"
+
+DEPEND="
+	>=dev-lang/go-1.23.4
+	>=dev-build/cmake-3.24
+	>=sys-devel/gcc-11.4.0
+	cuda? ( dev-util/nvidia-cuda-toolkit )
+	video_cards_amdgpu? (
+		sci-libs/hipBLAS[${ROCM_USEDEP}]
+	)
+"
+
+pkg_pretend() {
+	if use video_cards_amdgpu; then
+		ewarn "WARNING: AMD support in this ebuild are experimental"
+		einfo "If you run into issues, especially compiling dev-libs/rocm-opencl-runtime"
+		einfo "you may try the docker image here https://github.com/ROCm/ROCm-docker"
+		einfo "and follow instructions here"
+		einfo "https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/docker.html"
+	fi
+}
+
+src_prepare() {
+	default
+
+	if use video_cards_amdgpu; then
+		# --hip-version gets appended to the compile flags which isn't a known flag.
+		# This causes rocm builds to fail because -Wunused-command-line-argument is turned on.
+		# Use nuclear option to fix this.
+		# Disable -Werror's from go modules.
+		find "${S}" -name ".go" -exec sed -i "s/ -Werror / /g" {} + || die
+	fi
+}
+
+src_compile() {
+	CUSTOM_CPU_FLAGS=""
+	use cpu_flags_x86_avx && CUSTOM_CPU_FLAGS+="avx"
+	use cpu_flags_x86_avx2 && CUSTOM_CPU_FLAGS+=",avx2"
+	use cpu_flags_x86_avx512f && CUSTOM_CPU_FLAGS+=",avx512"
+	use cpu_flags_x86_avx512vbmi && CUSTOM_CPU_FLAGS+=",avx512vbmi"
+	use cpu_flags_x86_avx512_vnni && CUSTOM_CPU_FLAGS+=",avx512vnni"
+	use cpu_flags_x86_avx512_bf16 && CUSTOM_CPU_FLAGS+=",avx512bf16"
+
+	# Build basic ollama executable with cpu features built in
+	export CUSTOM_CPU_FLAGS
+
+	if use video_cards_amdgpu; then
+		export HIP_ARCHS=$(get_amdgpu_flags)
+		export HIP_PATH="/usr"
+	else
+		export OLLAMA_SKIP_ROCM_GENERATE=1
+	fi
+
+	if ! use cuda; then
+		export OLLAMA_SKIP_CUDA_GENERATE=1
+	fi
+	emake dist
+}
+
+src_install() {
+	dobin dist/linux-${ARCH}/bin/ollama
+
+	if [[ -d "dist/linux-${ARCH}/lib/ollama" ]] ; then
+		insinto /usr/lib
+		doins -r dist/linux-${ARCH}/lib/ollama
+	fi
+
+	doinitd "${FILESDIR}"/ollama
+}
+
+pkg_preinst() {
+	keepdir /var/log/ollama
+	fowners ollama:ollama /var/log/ollama
+}
+
+pkg_postinst() {
+	einfo "Quick guide:"
+	einfo "ollama serve"
+	einfo "ollama run llama3:70b"
+	einfo "See available models at https://ollama.com/library"
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-misc/ollama/
@ 2025-01-31 19:13 Yahor Berdnikau
  0 siblings, 0 replies; 6+ messages in thread
From: Yahor Berdnikau @ 2025-01-31 19:13 UTC (permalink / raw
  To: gentoo-commits

commit:     1879435c4a4365e815a275c8c40069c7b5f99b9a
Author:     Yahor Berdnikau <egorr.berd <AT> gmail <DOT> com>
AuthorDate: Fri Jan 31 19:13:09 2025 +0000
Commit:     Yahor Berdnikau <egorr.berd <AT> gmail <DOT> com>
CommitDate: Fri Jan 31 19:13:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1879435c

app-misc/ollama: keyword 0.5.7 for ~amd64

Bug: https://bugs.gentoo.org/946268
Signed-off-by: Yahor Berdnikau <egorr.berd <AT> gmail.com>

 app-misc/ollama/ollama-0.5.7.ebuild | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app-misc/ollama/ollama-0.5.7.ebuild b/app-misc/ollama/ollama-0.5.7.ebuild
index 408c054e1..f1373d6fa 100644
--- a/app-misc/ollama/ollama-0.5.7.ebuild
+++ b/app-misc/ollama/ollama-0.5.7.ebuild
@@ -14,6 +14,8 @@ S="${WORKDIR}/${PN}-${PV}"
 LICENSE="MIT"
 SLOT="0"
 
+KEYWORDS="~amd64"
+
 IUSE="cuda video_cards_amdgpu
 cpu_flags_x86_avx cpu_flags_x86_avx2
 cpu_flags_x86_avx512f cpu_flags_x86_avx512vbmi cpu_flags_x86_avx512_vnni cpu_flags_x86_avx512_bf16


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-01-31 19:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-26  9:04 [gentoo-commits] repo/proj/guru:dev commit in: app-misc/ollama/ Yahor Berdnikau
  -- strict thread matches above, loose matches on Subject: below --
2025-01-31 19:13 Yahor Berdnikau
2025-01-31 18:41 Yahor Berdnikau
2024-12-12 19:36 Eric Joldasov
2024-09-19 11:58 Anna Vyalkova
2024-09-19 11:27 Ivan Lloro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox