From fb3c9311eb62afd0fc679a2ac03cf9008d9024e7 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 11:35:47 +0200 Subject: [PATCH 01/14] Update Windows OS version in CI workflow to windows-2019 --- .github/workflows/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 290745e..a8e8224 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,11 +34,11 @@ jobs: arch: arm64 name: linux-gpu make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON" - - os: windows-latest + - os: windows-2019 arch: x86_64 name: windows-cpu make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_AVX2=ON" - - os: windows-latest + - os: windows-2019 arch: x86_64 name: windows-gpu make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON" @@ -101,7 +101,7 @@ jobs: echo "basekit-url=$BASEKIT_URL_HASH" >> $GITHUB_OUTPUT - uses: msys2/setup-msys2@v2.27.0 - if: matrix.os == 'windows-latest' + if: matrix.os == 'windows-2019' with: msystem: mingw64 install: >- @@ -182,45 +182,45 @@ jobs: key: miniaudio-${{ matrix.name }}-${{ matrix.os }}-${{ matrix.arch }}-${{ steps.submodule-hashes.outputs.miniaudio }}-${{ hashFiles('modules/miniaudio/**') }}-${{ steps.submodule-hashes.outputs.make }}-${{ steps.submodule-hashes.outputs.makefile }} - name: windows build llama.cpp - if: matrix.os == 'windows-latest' && steps.cache-llama.outputs.cache-hit != 'true' + if: matrix.os == 'windows-2019' && steps.cache-llama.outputs.cache-hit != 'true' shell: msys2 {0} run: make build/llama.cpp.stamp ${{ matrix.make && matrix.make || ''}} env: VULKAN_SDK: "C:/msys64/mingw64" - name: unix build llama.cpp - if: matrix.os != 'windows-latest' && steps.cache-llama.outputs.cache-hit != 'true' + if: matrix.os != 'windows-2019' && steps.cache-llama.outputs.cache-hit != 'true' run: make build/llama.cpp.stamp ${{ matrix.make && matrix.make || ''}} - name: windows build whisper.cpp - if: matrix.os == 'windows-latest' && steps.cache-whisper.outputs.cache-hit != 'true' + if: matrix.os == 'windows-2019' && steps.cache-whisper.outputs.cache-hit != 'true' shell: msys2 {0} run: make build/whisper.cpp.stamp ${{ matrix.make && matrix.make || ''}} env: VULKAN_SDK: "C:/msys64/mingw64" - name: unix build whisper.cpp - if: matrix.os != 'windows-latest' && steps.cache-whisper.outputs.cache-hit != 'true' + if: matrix.os != 'windows-2019' && steps.cache-whisper.outputs.cache-hit != 'true' run: make build/whisper.cpp.stamp ${{ matrix.make && matrix.make || ''}} - name: windows build miniaudio - if: matrix.os == 'windows-latest' && steps.cache-miniaudio.outputs.cache-hit != 'true' + if: matrix.os == 'windows-2019' && steps.cache-miniaudio.outputs.cache-hit != 'true' shell: msys2 {0} run: make build/miniaudio.stamp ${{ matrix.make && matrix.make || ''}} - name: unix build miniaudio - if: matrix.os != 'windows-latest' && steps.cache-miniaudio.outputs.cache-hit != 'true' + if: matrix.os != 'windows-2019' && steps.cache-miniaudio.outputs.cache-hit != 'true' run: make build/miniaudio.stamp ${{ matrix.make && matrix.make || ''}} - name: windows build sqlite-ai - if: matrix.os == 'windows-latest' + if: matrix.os == 'windows-2019' run: make extension ${{ matrix.make && matrix.make || ''}} shell: msys2 {0} env: VULKAN_SDK: "C:/msys64/mingw64" - name: unix build sqlite-ai - if: matrix.os != 'windows-latest' + if: matrix.os != 'windows-2019' run: make extension ${{ matrix.make && matrix.make || ''}} - name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION @@ -272,7 +272,7 @@ jobs: adb shell "sh /data/local/tmp/commands.sh" - name: windows test sqlite-ai - if: matrix.os == 'windows-latest' + if: matrix.os == 'windows-2019' run: make test ${{ matrix.make && matrix.make || ''}} shell: msys2 {0} env: From e6d3e4f107265920d92a98e95e08a6a15f870b5a Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 11:42:12 +0200 Subject: [PATCH 02/14] Update CI workflow to use Windows 2022 for builds and tests --- .github/workflows/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a8e8224..fc61e42 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,11 +34,11 @@ jobs: arch: arm64 name: linux-gpu make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON" - - os: windows-2019 + - os: windows-2022 arch: x86_64 name: windows-cpu make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_AVX2=ON" - - os: windows-2019 + - os: windows-2022 arch: x86_64 name: windows-gpu make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON" @@ -101,7 +101,7 @@ jobs: echo "basekit-url=$BASEKIT_URL_HASH" >> $GITHUB_OUTPUT - uses: msys2/setup-msys2@v2.27.0 - if: matrix.os == 'windows-2019' + if: matrix.os == 'windows-2022' with: msystem: mingw64 install: >- @@ -182,45 +182,45 @@ jobs: key: miniaudio-${{ matrix.name }}-${{ matrix.os }}-${{ matrix.arch }}-${{ steps.submodule-hashes.outputs.miniaudio }}-${{ hashFiles('modules/miniaudio/**') }}-${{ steps.submodule-hashes.outputs.make }}-${{ steps.submodule-hashes.outputs.makefile }} - name: windows build llama.cpp - if: matrix.os == 'windows-2019' && steps.cache-llama.outputs.cache-hit != 'true' + if: matrix.os == 'windows-2022' && steps.cache-llama.outputs.cache-hit != 'true' shell: msys2 {0} run: make build/llama.cpp.stamp ${{ matrix.make && matrix.make || ''}} env: VULKAN_SDK: "C:/msys64/mingw64" - name: unix build llama.cpp - if: matrix.os != 'windows-2019' && steps.cache-llama.outputs.cache-hit != 'true' + if: matrix.os != 'windows-2022' && steps.cache-llama.outputs.cache-hit != 'true' run: make build/llama.cpp.stamp ${{ matrix.make && matrix.make || ''}} - name: windows build whisper.cpp - if: matrix.os == 'windows-2019' && steps.cache-whisper.outputs.cache-hit != 'true' + if: matrix.os == 'windows-2022' && steps.cache-whisper.outputs.cache-hit != 'true' shell: msys2 {0} run: make build/whisper.cpp.stamp ${{ matrix.make && matrix.make || ''}} env: VULKAN_SDK: "C:/msys64/mingw64" - name: unix build whisper.cpp - if: matrix.os != 'windows-2019' && steps.cache-whisper.outputs.cache-hit != 'true' + if: matrix.os != 'windows-2022' && steps.cache-whisper.outputs.cache-hit != 'true' run: make build/whisper.cpp.stamp ${{ matrix.make && matrix.make || ''}} - name: windows build miniaudio - if: matrix.os == 'windows-2019' && steps.cache-miniaudio.outputs.cache-hit != 'true' + if: matrix.os == 'windows-2022' && steps.cache-miniaudio.outputs.cache-hit != 'true' shell: msys2 {0} run: make build/miniaudio.stamp ${{ matrix.make && matrix.make || ''}} - name: unix build miniaudio - if: matrix.os != 'windows-2019' && steps.cache-miniaudio.outputs.cache-hit != 'true' + if: matrix.os != 'windows-2022' && steps.cache-miniaudio.outputs.cache-hit != 'true' run: make build/miniaudio.stamp ${{ matrix.make && matrix.make || ''}} - name: windows build sqlite-ai - if: matrix.os == 'windows-2019' + if: matrix.os == 'windows-2022' run: make extension ${{ matrix.make && matrix.make || ''}} shell: msys2 {0} env: VULKAN_SDK: "C:/msys64/mingw64" - name: unix build sqlite-ai - if: matrix.os != 'windows-2019' + if: matrix.os != 'windows-2022' run: make extension ${{ matrix.make && matrix.make || ''}} - name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION @@ -272,7 +272,7 @@ jobs: adb shell "sh /data/local/tmp/commands.sh" - name: windows test sqlite-ai - if: matrix.os == 'windows-2019' + if: matrix.os == 'windows-2022' run: make test ${{ matrix.make && matrix.make || ''}} shell: msys2 {0} env: From 3aabd327910c928814b1696e3ffbedf92d194d56 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 11:52:07 +0200 Subject: [PATCH 03/14] Update Makefile to skip stripping on Windows builds --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4b3f8f1..03db9db 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll LDFLAGS += -shared -lbcrypt -lgomp -lstdc++ DEF_FILE := $(BUILD_DIR)/ai.def - STRIP = strip --strip-unneeded $@ + STRIP = echo "Windows skip stripping" #strip --strip-unneeded $@ else ifeq ($(PLATFORM),macos) TARGET := $(DIST_DIR)/ai.dylib LLAMA_LIBS += $(BUILD_GGML)/lib/libggml-metal.a From fd4c1945e3fe5c0440face106d094f43a6470846 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 12:00:56 +0200 Subject: [PATCH 04/14] Reorder LDFLAGS for Windows platform in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 03db9db..f5daa50 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -shared -lbcrypt -lgomp -lstdc++ + LDFLAGS += -lbcrypt -lgomp -lstdc++ -shared DEF_FILE := $(BUILD_DIR)/ai.def STRIP = echo "Windows skip stripping" #strip --strip-unneeded $@ else ifeq ($(PLATFORM),macos) From 60d006c10caf6de6c9d8a9e0c2d93dfe2c51b175 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 12:26:44 +0200 Subject: [PATCH 05/14] Update Makefile for Windows platform: refine LDFLAGS, disable GGML_OPENMP, and streamline build arguments --- Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f5daa50..1bb4b38 100644 --- a/Makefile +++ b/Makefile @@ -66,9 +66,11 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -lbcrypt -lgomp -lstdc++ -shared + LDFLAGS += -lbcrypt -lstdc++ -shared DEF_FILE := $(BUILD_DIR)/ai.def - STRIP = echo "Windows skip stripping" #strip --strip-unneeded $@ + LLAMA_OPTIONS += -DGGML_OPENMP=OFF + WHISPER_OPTIONS += -DGGML_OPENMP=OFF + STRIP = strip --strip-unneeded $@ else ifeq ($(PLATFORM),macos) TARGET := $(DIST_DIR)/ai.dylib LLAMA_LIBS += $(BUILD_GGML)/lib/libggml-metal.a @@ -211,11 +213,7 @@ test: $(TARGET) # Build submodules ifeq ($(PLATFORM),windows) - ifneq (,$(findstring Ninja,$(LLAMA))) - ARGS = -j $(CPUS) - else - ARGS = --parallel $(CPUS) - endif + ARGS = --parallel $(CPUS) else ARGS = -- -j$(CPUS) endif From 3bd9f5ad48ddefe87c30d8e1b2bea3b30a145c64 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 12:42:44 +0200 Subject: [PATCH 06/14] Update Makefile for Windows platform: enhance LDFLAGS with static linking options and disable GGML_OPENMP --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1bb4b38..13a5cab 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -lbcrypt -lstdc++ -shared + LDFLAGS += -lbcrypt -static-libgcc -static-libstdc++ -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic -shared DEF_FILE := $(BUILD_DIR)/ai.def LLAMA_OPTIONS += -DGGML_OPENMP=OFF WHISPER_OPTIONS += -DGGML_OPENMP=OFF From 02d0d618f5ab63f98bb6ef732fe80f1b26dd2da6 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 12:51:58 +0200 Subject: [PATCH 07/14] Update Makefile for Windows platform: simplify LDFLAGS by removing unnecessary flags --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 13a5cab..36e3194 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -lbcrypt -static-libgcc -static-libstdc++ -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic -shared + LDFLAGS += -lbcrypt -static -shared DEF_FILE := $(BUILD_DIR)/ai.def LLAMA_OPTIONS += -DGGML_OPENMP=OFF WHISPER_OPTIONS += -DGGML_OPENMP=OFF From 0c6f9bd3ea748d426808a2958b9d83522d757962 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 13:16:25 +0200 Subject: [PATCH 08/14] Update Makefile for Windows platform: enhance LDFLAGS with static linking options and adjust threading library --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 36e3194..991141e 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -lbcrypt -static -shared + LDFLAGS += -static-libgcc -static-libstdc++ -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic -lbcrypt -shared DEF_FILE := $(BUILD_DIR)/ai.def LLAMA_OPTIONS += -DGGML_OPENMP=OFF WHISPER_OPTIONS += -DGGML_OPENMP=OFF From 4db44312eac8be4b805090a9dfcb0afae1915f0b Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 14:03:00 +0200 Subject: [PATCH 09/14] Update Makefile for Windows platform: refine LDFLAGS to improve static linking and adjust library order --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 991141e..6e36a7b 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -static-libgcc -static-libstdc++ -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic -lbcrypt -shared + LDFLAGS += -lbcrypt -static-libgcc -Wl,--push-state,-Bstatic,-lstdc++,-lwinpthread,--pop-state -shared DEF_FILE := $(BUILD_DIR)/ai.def LLAMA_OPTIONS += -DGGML_OPENMP=OFF WHISPER_OPTIONS += -DGGML_OPENMP=OFF From 0212ad4e1c0cfc1f6c698e438107b7de32c743d7 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 14:21:09 +0200 Subject: [PATCH 10/14] Update Makefile for Windows platform: modify LDFLAGS to include OpenMP support and adjust shared library flags --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6e36a7b..9403d8d 100644 --- a/Makefile +++ b/Makefile @@ -66,10 +66,8 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -lbcrypt -static-libgcc -Wl,--push-state,-Bstatic,-lstdc++,-lwinpthread,--pop-state -shared + LDFLAGS += -lbcrypt -lgomp -static-libgcc -Wl,--push-state,-Bstatic,-lstdc++,-lwinpthread,--pop-state -shared DEF_FILE := $(BUILD_DIR)/ai.def - LLAMA_OPTIONS += -DGGML_OPENMP=OFF - WHISPER_OPTIONS += -DGGML_OPENMP=OFF STRIP = strip --strip-unneeded $@ else ifeq ($(PLATFORM),macos) TARGET := $(DIST_DIR)/ai.dylib From 02199046e509ffc2e22a429106441a1e1ab5549f Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 14:30:28 +0200 Subject: [PATCH 11/14] Update Makefile for Windows platform: adjust LDFLAGS to reorder static and dynamic library flags --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9403d8d..f6fb9e6 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -lbcrypt -lgomp -static-libgcc -Wl,--push-state,-Bstatic,-lstdc++,-lwinpthread,--pop-state -shared + LDFLAGS += -lbcrypt -static-libgcc -Wl,--push-state,-Bstatic,-lstdc++,-lwinpthread,-lgomp,--pop-state -shared DEF_FILE := $(BUILD_DIR)/ai.def STRIP = strip --strip-unneeded $@ else ifeq ($(PLATFORM),macos) From a0b486fd43399bf882c3cced291bc64a9f5d190f Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 14:38:49 +0200 Subject: [PATCH 12/14] Update Makefile for Windows platform: modify LDFLAGS to use static OpenMP library for improved linking --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f6fb9e6..708bb4f 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -lbcrypt -static-libgcc -Wl,--push-state,-Bstatic,-lstdc++,-lwinpthread,-lgomp,--pop-state -shared + LDFLAGS += -lbcrypt -static-libgcc -static-libgomp -Wl,--push-state,-Bstatic,-lstdc++,-lwinpthread,--pop-state -shared DEF_FILE := $(BUILD_DIR)/ai.def STRIP = strip --strip-unneeded $@ else ifeq ($(PLATFORM),macos) From 13c53426f1de285eab78848fb8d2e097fe6cc582 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 14:45:14 +0200 Subject: [PATCH 13/14] Update Makefile for Windows platform: refine LDFLAGS to adjust OpenMP linking options --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 708bb4f..11e22a6 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a # Platform-specific settings ifeq ($(PLATFORM),windows) TARGET := $(DIST_DIR)/ai.dll - LDFLAGS += -lbcrypt -static-libgcc -static-libgomp -Wl,--push-state,-Bstatic,-lstdc++,-lwinpthread,--pop-state -shared + LDFLAGS += -lbcrypt -static-libgcc -Wl,--push-state,-Bstatic,-lgomp,-lstdc++,-lwinpthread,--pop-state -shared DEF_FILE := $(BUILD_DIR)/ai.def STRIP = strip --strip-unneeded $@ else ifeq ($(PLATFORM),macos) From 5e900f2e40d4e8c33aaebaf642a90fb199204007 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Tue, 5 Aug 2025 14:55:29 +0200 Subject: [PATCH 14/14] Update sqlite-ai.h: bump version to 0.5.7 --- src/sqlite-ai.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sqlite-ai.h b/src/sqlite-ai.h index 728eb76..1a1e41e 100644 --- a/src/sqlite-ai.h +++ b/src/sqlite-ai.h @@ -24,7 +24,7 @@ extern "C" { #endif -#define SQLITE_AI_VERSION "0.5.6" +#define SQLITE_AI_VERSION "0.5.7" SQLITE_AI_API int sqlite3_ai_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);