Skip to content

Commit

Permalink
Merge pull request msys2#21561 from lazka/ollama-0.1.45
Browse files Browse the repository at this point in the history
ollama: Update to 0.1.45
  • Loading branch information
lazka authored Aug 3, 2024
2 parents fe63c6f + 205bffa commit 98e6c20
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
26 changes: 26 additions & 0 deletions mingw-w64-ollama/0001-use-ninja-cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- ollama/llm/generate/gen_windows.ps1.orig 2024-08-04 00:28:10.253728700 +0200
+++ ollama/llm/generate/gen_windows.ps1 2024-08-04 00:28:46.951209800 +0200
@@ -38,6 +38,7 @@
$script:cmakeTargets = @("ollama_llama_server")
}
$script:cmakeDefs = @(
+ "-G", "Ninja",
"-DBUILD_SHARED_LIBS=on",
"-DLLAMA_NATIVE=off",
"-DLLAMA_OPENMP=off"
@@ -195,14 +196,10 @@
# as we need this to be compiled by gcc for golang to be able to link with itx
write-host "Checking for MinGW..."
# error action ensures we exit on failure
- get-command gcc
- get-command mingw32-make
$oldTargets = $script:cmakeTargets
$script:cmakeTargets = @("llama", "ggml")
$script:cmakeDefs = @(
- "-G", "MinGW Makefiles"
- "-DCMAKE_C_COMPILER=gcc.exe",
- "-DCMAKE_CXX_COMPILER=g++.exe",
+ "-G", "Ninja"
"-DBUILD_SHARED_LIBS=off",
"-DLLAMA_NATIVE=off",
"-DLLAMA_AVX=off",
24 changes: 11 additions & 13 deletions mingw-w64-ollama/0002-remove-cmake-arch.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -bur ollama-orig/llm/generate/gen_windows.ps1 ollama/llm/generate/gen_windows.ps1
--- ollama-orig/llm/generate/gen_windows.ps1 2024-05-12 04:49:05.349302900 -0600
+++ ollama/llm/generate/gen_windows.ps1 2024-05-12 04:49:08.848582300 -0600
@@ -217,7 +217,7 @@
--- ollama/llm/generate/gen_windows.ps1.orig 2024-08-04 00:28:10.253728700 +0200
+++ ollama/llm/generate/gen_windows.ps1 2024-08-04 00:28:46.951209800 +0200
@@ -224,7 +221,7 @@
if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu"))) {
# remaining llama.cpp builds use MSVC
init_vars
Expand All @@ -10,7 +9,7 @@ diff -bur ollama-orig/llm/generate/gen_windows.ps1 ollama/llm/generate/gen_windo
$script:buildDir="../build/windows/${script:ARCH}/cpu"
$script:distDir="$script:DIST_BASE\cpu"
write-host "Building LCD CPU"
@@ -232,7 +232,7 @@
@@ -239,7 +236,7 @@
function build_cpu_avx() {
if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu_avx"))) {
init_vars
Expand All @@ -19,7 +18,7 @@ diff -bur ollama-orig/llm/generate/gen_windows.ps1 ollama/llm/generate/gen_windo
$script:buildDir="../build/windows/${script:ARCH}/cpu_avx"
$script:distDir="$script:DIST_BASE\cpu_avx"
write-host "Building AVX CPU"
@@ -247,7 +247,7 @@
@@ -254,7 +251,7 @@
function build_cpu_avx2() {
if ((-not "${env:OLLAMA_SKIP_CPU_GENERATE}" ) -and ((-not "${env:OLLAMA_CPU_TARGET}") -or ("${env:OLLAMA_CPU_TARGET}" -eq "cpu_avx2"))) {
init_vars
Expand All @@ -28,12 +27,11 @@ diff -bur ollama-orig/llm/generate/gen_windows.ps1 ollama/llm/generate/gen_windo
$script:buildDir="../build/windows/${script:ARCH}/cpu_avx2"
$script:distDir="$script:DIST_BASE\cpu_avx2"
write-host "Building AVX2 CPU"
@@ -270,7 +270,7 @@
init_vars
@@ -278,7 +275,6 @@
$script:buildDir="../build/windows/${script:ARCH}/cuda$script:CUDA_VARIANT"
$script:distDir="$script:DIST_BASE\cuda$script:CUDA_VARIANT"
- $script:cmakeDefs += @("-A", "x64", "-DLLAMA_CUDA=ON", "-DLLAMA_AVX=on", "-DLLAMA_AVX2=off", "-DCUDAToolkit_INCLUDE_DIR=$script:CUDA_INCLUDE_DIR", "-DCMAKE_CUDA_ARCHITECTURES=${script:CMAKE_CUDA_ARCHITECTURES}")
+ $script:cmakeDefs += @("-DLLAMA_CUDA=ON", "-DLLAMA_AVX=on", "-DLLAMA_AVX2=off", "-DCUDAToolkit_INCLUDE_DIR=$script:CUDA_INCLUDE_DIR", "-DCMAKE_CUDA_ARCHITECTURES=${script:CMAKE_CUDA_ARCHITECTURES}")
if ($null -ne $env:OLLAMA_CUSTOM_CUDA_DEFS) {
write-host "OLLAMA_CUSTOM_CUDA_DEFS=`"${env:OLLAMA_CUSTOM_CUDA_DEFS}`""
$script:cmakeDefs +=@("${env:OLLAMA_CUSTOM_CUDA_DEFS}")
$script:cmakeDefs += @(
- "-A", "x64",
"-DLLAMA_CUDA=ON",
"-DLLAMA_AVX=on",
"-DLLAMA_AVX2=off",
14 changes: 9 additions & 5 deletions mingw-w64-ollama/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ _realname=ollama
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgdesc='Create, run and share large language models (LLMs) (mingw-w64)'
pkgver=0.1.44
pkgver=0.1.45
pkgrel=1
arch=(any)
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
msys2_repository_url='https://github.com/ollama/ollama'
url='https://ollama.com'
license=('spdx:MIT')
makedepends=(git
${MINGW_PACKAGE_PREFIX}-cmake
${MINGW_PACKAGE_PREFIX}-go
${MINGW_PACKAGE_PREFIX}-gcc
${MINGW_PACKAGE_PREFIX}-make)
${MINGW_PACKAGE_PREFIX}-cc
${MINGW_PACKAGE_PREFIX}-ninja)
source=(git+https://github.com/ollama/ollama/#tag=v$pkgver
0001-use-ninja-cc.patch
0002-remove-cmake-arch.patch
0003-missing-main.patch
)
b2sums=('cadb0df81c9e6d2941ad31b4b7b0e901da98174c9f5c37c65e911d7ee3cad2601fb8b070406d97535f592a5164f0c5da82a6f3f3b065e2bc3dab3ee09f532399'
'1c002778e73548a762cb306024ee3920d767eaa284ee33673594fe83fac39a4bb119125e2c6513ac13ebb8fc540abb7ab18edb52f6f659d37cfb689f8af896b5'
b2sums=('109eee6c42771c3fb3170fbf1602c624c051b56e1f74464a6f1f3ad22ba7b78130b1e295ca912b3c94a0531b12a6111abe856a2f2e8ba1a6ad570a9f4a78bfcc'
'f7d0879545bcec8aa3d1dbeed5afc6fe65992f34737e0739c7c8debae53e84688b9f072928e90eedd322339945f248ba0f11cedc2e8cb90177cc3a06316b1bad'
'd56b6caf68818b6567ceb006d439f8f24a1bc8420cb520cb6d7bd5d2ff45423d94127fa5bc890625674b04771b94171a66189e450cac1e03b4fe9243166653bf'
'013f57a5193142509d20c2fc0053442291f067d8993293ca77760f712959910313c7210027c49ef206288e7fe0299715f071a6c99f46071288617ff511351818')

apply_patch_with_msg() {
Expand All @@ -33,6 +36,7 @@ prepare() {
cd $_realname

apply_patch_with_msg \
../0001-use-ninja-cc.patch \
../0002-remove-cmake-arch.patch \
../0003-missing-main.patch

Expand Down

0 comments on commit 98e6c20

Please sign in to comment.