summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD23
1 files changed, 13 insertions, 10 deletions
diff --git a/PKGBUILD b/PKGBUILD
index bccf3d688019..1ce4327ca1c5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,14 @@
# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Matt Harrison <matt@harrison.us.com>
-pkgname=ollama-cuda-git
-pkgdesc='Create, run and share large language models (LLMs) with CUDA'
-pkgver=0.1.27.g275ea015
+pkgname=ollama-rocm-git
+pkgdesc='Create, run and share large language models (LLMs) with ROCm'
+pkgver=0.1.27.g076237b8
pkgrel=1
arch=(x86_64)
url='https://github.com/jmorganca/ollama'
license=(MIT)
-makedepends=(cmake cuda git go)
+makedepends=(cmake clblast rocblas git go)
provides=(ollama)
conflicts=(ollama ollama-cuda)
source=(git+$url
@@ -21,7 +21,7 @@ b2sums=('SKIP'
'e8f2b19e2474f30a4f984b45787950012668bf0acb5ad1ebb25cd9776925ab4a6aa927f8131ed53e35b1c71b32c504c700fe5b5145ecd25c7a8284373bb951ed')
pkgver() {
- cd ${pkgname/-cuda-git}
+ cd ${pkgname/-rocm-git}
local _tag=$(git describe --tags --abbrev=0 | sed "s/^v//")
local _commit=$(git describe --abbrev=8 --always)
@@ -29,7 +29,7 @@ pkgver() {
}
prepare() {
- cd ${pkgname/-cuda-git}
+ cd ${pkgname/-rocm-git}
# Clone submodules (llama.cpp)
git submodule update --init --recursive
@@ -37,12 +37,15 @@ prepare() {
# Turn LTO on and set the build type to Release
sed -i 's,T_CODE=on,T_CODE=on -D LLAMA_LTO=on -D CMAKE_BUILD_TYPE=Release,g' llm/generate/gen_linux.sh
+ # Fix linking (https://github.com/ollama/ollama/issues/2473#issuecomment-1942090475)
+ sed -i 's,g++,/opt/rocm/llvm/bin/clang++ -fcf-protection=none,g' llm/generate/gen_common.sh
+
# Display a more helpful error message
sed -i "s|could not connect to ollama server, run 'ollama serve' to start it|ollama is not running, try 'systemctl start ollama'|g" cmd/cmd.go
}
build() {
- cd ${pkgname/-cuda-git}
+ cd ${pkgname/-rocm-git}
export CGO_CFLAGS="$CFLAGS" CGO_CPPFLAGS="$CPPFLAGS" CGO_CXXFLAGS="$CXXFLAGS" CGO_LDFLAGS="$LDFLAGS"
go generate ./...
go build -buildmode=pie -trimpath -mod=readonly -modcacherw -ldflags=-linkmode=external \
@@ -50,16 +53,16 @@ build() {
}
check() {
- cd ${pkgname/-cuda-git}
+ cd ${pkgname/-rocm-git}
go test ./api ./format
./ollama --version > /dev/null
}
package() {
- install -Dm755 ${pkgname/-cuda-git}/${pkgname/-cuda-git} "$pkgdir/usr/bin/${pkgname/-cuda-git}"
+ install -Dm755 ${pkgname/-rocm-git}/${pkgname/-rocm-git} "$pkgdir/usr/bin/${pkgname/-rocm-git}"
install -dm755 "$pkgdir/var/lib/ollama"
install -Dm644 ollama.service "$pkgdir/usr/lib/systemd/system/ollama.service"
install -Dm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/ollama.conf"
install -Dm644 tmpfiles.d "$pkgdir/usr/lib/tmpfiles.d/ollama.conf"
- install -Dm644 ${pkgname/-cuda-git}/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm644 ${pkgname/-rocm-git}/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}