Skip to content

Commit 6d87d20

Browse files
authored
fix windows builds missing runtime libraries (#8)
* Update Windows OS version in CI workflow to windows-2019 * Update CI workflow to use Windows 2022 for builds and tests * Update Makefile to skip stripping on Windows builds * Reorder LDFLAGS for Windows platform in Makefile * Update Makefile for Windows platform: refine LDFLAGS, disable GGML_OPENMP, and streamline build arguments * Update Makefile for Windows platform: enhance LDFLAGS with static linking options and disable GGML_OPENMP * Update Makefile for Windows platform: simplify LDFLAGS by removing unnecessary flags * Update Makefile for Windows platform: enhance LDFLAGS with static linking options and adjust threading library * Update Makefile for Windows platform: refine LDFLAGS to improve static linking and adjust library order * Update Makefile for Windows platform: modify LDFLAGS to include OpenMP support and adjust shared library flags * Update Makefile for Windows platform: adjust LDFLAGS to reorder static and dynamic library flags * Update Makefile for Windows platform: modify LDFLAGS to use static OpenMP library for improved linking * Update Makefile for Windows platform: refine LDFLAGS to adjust OpenMP linking options * Update sqlite-ai.h: bump version to 0.5.7
1 parent 628ea6e commit 6d87d20

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ jobs:
3434
arch: arm64
3535
name: linux-gpu
3636
make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON"
37-
- os: windows-latest
37+
- os: windows-2022
3838
arch: x86_64
3939
name: windows-cpu
4040
make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_AVX2=ON"
41-
- os: windows-latest
41+
- os: windows-2022
4242
arch: x86_64
4343
name: windows-gpu
4444
make: LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON"
@@ -101,7 +101,7 @@ jobs:
101101
echo "basekit-url=$BASEKIT_URL_HASH" >> $GITHUB_OUTPUT
102102
103103
- uses: msys2/[email protected]
104-
if: matrix.os == 'windows-latest'
104+
if: matrix.os == 'windows-2022'
105105
with:
106106
msystem: mingw64
107107
install: >-
@@ -182,45 +182,45 @@ jobs:
182182
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 }}
183183

184184
- name: windows build llama.cpp
185-
if: matrix.os == 'windows-latest' && steps.cache-llama.outputs.cache-hit != 'true'
185+
if: matrix.os == 'windows-2022' && steps.cache-llama.outputs.cache-hit != 'true'
186186
shell: msys2 {0}
187187
run: make build/llama.cpp.stamp ${{ matrix.make && matrix.make || ''}}
188188
env:
189189
VULKAN_SDK: "C:/msys64/mingw64"
190190

191191
- name: unix build llama.cpp
192-
if: matrix.os != 'windows-latest' && steps.cache-llama.outputs.cache-hit != 'true'
192+
if: matrix.os != 'windows-2022' && steps.cache-llama.outputs.cache-hit != 'true'
193193
run: make build/llama.cpp.stamp ${{ matrix.make && matrix.make || ''}}
194194

195195
- name: windows build whisper.cpp
196-
if: matrix.os == 'windows-latest' && steps.cache-whisper.outputs.cache-hit != 'true'
196+
if: matrix.os == 'windows-2022' && steps.cache-whisper.outputs.cache-hit != 'true'
197197
shell: msys2 {0}
198198
run: make build/whisper.cpp.stamp ${{ matrix.make && matrix.make || ''}}
199199
env:
200200
VULKAN_SDK: "C:/msys64/mingw64"
201201

202202
- name: unix build whisper.cpp
203-
if: matrix.os != 'windows-latest' && steps.cache-whisper.outputs.cache-hit != 'true'
203+
if: matrix.os != 'windows-2022' && steps.cache-whisper.outputs.cache-hit != 'true'
204204
run: make build/whisper.cpp.stamp ${{ matrix.make && matrix.make || ''}}
205205

206206
- name: windows build miniaudio
207-
if: matrix.os == 'windows-latest' && steps.cache-miniaudio.outputs.cache-hit != 'true'
207+
if: matrix.os == 'windows-2022' && steps.cache-miniaudio.outputs.cache-hit != 'true'
208208
shell: msys2 {0}
209209
run: make build/miniaudio.stamp ${{ matrix.make && matrix.make || ''}}
210210

211211
- name: unix build miniaudio
212-
if: matrix.os != 'windows-latest' && steps.cache-miniaudio.outputs.cache-hit != 'true'
212+
if: matrix.os != 'windows-2022' && steps.cache-miniaudio.outputs.cache-hit != 'true'
213213
run: make build/miniaudio.stamp ${{ matrix.make && matrix.make || ''}}
214214

215215
- name: windows build sqlite-ai
216-
if: matrix.os == 'windows-latest'
216+
if: matrix.os == 'windows-2022'
217217
run: make extension ${{ matrix.make && matrix.make || ''}}
218218
shell: msys2 {0}
219219
env:
220220
VULKAN_SDK: "C:/msys64/mingw64"
221221

222222
- name: unix build sqlite-ai
223-
if: matrix.os != 'windows-latest'
223+
if: matrix.os != 'windows-2022'
224224
run: make extension ${{ matrix.make && matrix.make || ''}}
225225

226226
- name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION
@@ -272,7 +272,7 @@ jobs:
272272
adb shell "sh /data/local/tmp/commands.sh"
273273
274274
- name: windows test sqlite-ai
275-
if: matrix.os == 'windows-latest'
275+
if: matrix.os == 'windows-2022'
276276
run: make test ${{ matrix.make && matrix.make || ''}}
277277
shell: msys2 {0}
278278
env:

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a
6666
# Platform-specific settings
6767
ifeq ($(PLATFORM),windows)
6868
TARGET := $(DIST_DIR)/ai.dll
69-
LDFLAGS += -shared -lbcrypt -lgomp -lstdc++
69+
LDFLAGS += -lbcrypt -static-libgcc -Wl,--push-state,-Bstatic,-lgomp,-lstdc++,-lwinpthread,--pop-state -shared
7070
DEF_FILE := $(BUILD_DIR)/ai.def
7171
STRIP = strip --strip-unneeded $@
7272
else ifeq ($(PLATFORM),macos)
@@ -211,11 +211,7 @@ test: $(TARGET)
211211

212212
# Build submodules
213213
ifeq ($(PLATFORM),windows)
214-
ifneq (,$(findstring Ninja,$(LLAMA)))
215-
ARGS = -j $(CPUS)
216-
else
217-
ARGS = --parallel $(CPUS)
218-
endif
214+
ARGS = --parallel $(CPUS)
219215
else
220216
ARGS = -- -j$(CPUS)
221217
endif

src/sqlite-ai.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
extern "C" {
2525
#endif
2626

27-
#define SQLITE_AI_VERSION "0.5.6"
27+
#define SQLITE_AI_VERSION "0.5.7"
2828

2929
SQLITE_AI_API int sqlite3_ai_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);
3030

0 commit comments

Comments
 (0)