Alexander Rødseth pushed to branch main at Arch Linux / Packaging / Packages / 
ollama-cuda


Commits:
d030364f by Sammy Fischer at 2024-11-09T00:51:54+01:00
set mode to release, disabled LTO, linking against correct cuda lib

- - - - -
04f12b44 by Alexander F. Rødseth at 2024-11-09T00:52:50+01:00
Simplyfy + add cudart flags, WIP

- - - - -


1 changed file:

- PKGBUILD


Changes:

=====================================
PKGBUILD
=====================================
@@ -4,50 +4,41 @@
 # Contributor: Kainoa Kanter <[email protected]>
 
 pkgname=ollama-cuda
-pkgver=0.3.12
-pkgrel=4
+pkgver=0.4.0
+pkgrel=1
 pkgdesc='Create, run and share large language models (LLMs) with CUDA'
 arch=(x86_64)
 url='https://github.com/ollama/ollama'
-_llama_cpp_commit=$(curl -sL 
"https://github.com/ollama/ollama/tree/v$pkgver/llm"; | tr ' ' '\n' | tr '"' 
'\n' | grep ggerganov | cut -d/ -f5 | head -1)
 license=(MIT)
+makedepends=(cmake cuda git go)
 provides=(ollama)
 conflicts=(ollama)
 makedepends=(clblast cmake cuda git go)
 optdepends=('nvidia-utils: monitor GPU usage with nvidia-smi')
 source=(git+$url#tag=v$pkgver
-        
llama.cpp::git+https://github.com/ggerganov/llama.cpp#commit=$_llama_cpp_commit
         ollama.service
         sysusers.conf
         tmpfiles.d)
-b2sums=('7b230922a233f0be967abb40b300125fb59ed64850a109db185954c549e12e5de0c1be094c1cdb67484c9e8705804a3761bfefa517fac1adfb05bcae8d2c197d'
-        
'e568ac334cf07b69f98c4581f212f2e30bdebf1f285a37e4bb5c8ac31733df9a3c125e6d16b7f6bbe412cedb11d249a07ca9793a487e0ad34810cbb35cd32ee2'
+b2sums=('f32a0be8c057ec9f574ac8eb685bec96421512b4146593373d2ff47088264f3d8295424065606d5106b1fad2e6c0dcda45684fb1c1038791b26f78042b26fd88'
         
'031e0809a7f564de87017401c83956d43ac29bd0e988b250585af728b952a27d139b3cad0ab1e43750e2cd3b617287d3b81efc4a70ddd61709127f68bd15eabd'
         
'3aabf135c4f18e1ad745ae8800db782b25b15305dfeaaa031b4501408ab7e7d01f66e8ebb5be59fc813cfbff6788d08d2e48dcf24ecc480a40ec9db8dbce9fec'
         
'e8f2b19e2474f30a4f984b45787950012668bf0acb5ad1ebb25cd9776925ab4a6aa927f8131ed53e35b1c71b32c504c700fe5b5145ecd25c7a8284373bb951ed')
 
 prepare() {
-  echo "Using llama.cpp git submodule commit $_llama_cpp_commit"
-
-  # Prepare the git submodule by copying in files (the build process is 
sensitive to symlinks)
-  rm -frv ollama/llm/llama.cpp
-  cp -r llama.cpp ollama/llm/llama.cpp
-
-  # Set the CMake build type to "Release"
-  sed -i 's,T_CODE=on,T_CODE=on -D CMAKE_BUILD_TYPE=Release,g' 
ollama/llm/generate/gen_linux.sh
+  # Set to Release by default
+  sed -i 's,var mode string = gin.DebugMode,var mode string = 
gin.ReleaseMode,g' ollama/server/routes.go
 }
 
 build() {
-  export CFLAGS+=' -w'
-  export CXXFLAGS+=' -w'
-  export LDFLAGS+=' -L/opt/cuda/targets/x86_64-linux/lib/stubs/'
+  export CFLAGS+=" $(pkg-config --cflags cudart) -w" CXXFLAGS+=" $(pkg-config 
--cflags cudart) -w"
+  export LDFLAGS+=" -L/opt/cuda/targets/x86_64-linux/lib/stubs/ $(pkg-config 
--libs cudart)"
   export CGO_CFLAGS="$CFLAGS" CGO_CPPFLAGS="$CPPFLAGS" 
CGO_CXXFLAGS="$CXXFLAGS" CGO_LDFLAGS="$LDFLAGS"
   local goflags='-buildmode=pie -trimpath -mod=readonly -modcacherw'
   local ldflags="-linkmode=external -buildid= -X 
github.com/ollama/ollama/version.Version=$pkgver -X 
github.com/ollama/ollama/server.mode=release"
   export CUDA_LIB_DIR=/opt/cuda/targets/x86_64-linux/lib
   cd ollama
   go generate ./...
-  go build $goflags -ldflags="$ldflags" -tags cuda
+  go build -tags cuda $goflags -ldflags="$ldflags"
 }
 
 check() {
@@ -63,6 +54,5 @@ package() {
   install -Dm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/ollama.conf"
   install -Dm644 tmpfiles.d "$pkgdir/usr/lib/tmpfiles.d/ollama.conf"
   install -Dm644 ollama/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-  install -Dm644 ollama/llm/llama.cpp/LICENSE 
"$pkgdir/usr/share/licenses/$pkgname/llama.cpp-LICENSE"
   ln -s /var/lib/ollama "$pkgdir/usr/share/ollama"
 }



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/ollama-cuda/-/compare/418ceefb60484899fe1ac728192d9ea65548a5f5...04f12b448b08592c848929119c2bdce9e7557d3f

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/ollama-cuda/-/compare/418ceefb60484899fe1ac728192d9ea65548a5f5...04f12b448b08592c848929119c2bdce9e7557d3f
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to