Skip to content

Commit f7e88cb

Browse files
author
Daniele Briggi
committed
fix(windows): missing codecvt link
1 parent 0e86c29 commit f7e88cb

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@ jobs:
8888
pacman -S --noconfirm git
8989
shell: msys2 {0}
9090

91+
- name: windows check compiler versions
92+
if: matrix.os == 'windows-latest'
93+
run: |
94+
echo "=== Compiler Versions ==="
95+
gcc --version
96+
g++ --version
97+
echo "=== C++17 Feature Test ==="
98+
echo '#include <iostream>' > test.cpp
99+
echo '#include <codecvt>' >> test.cpp
100+
echo '#include <locale>' >> test.cpp
101+
echo 'int main() { std::codecvt_utf8_utf16<wchar_t> conv; return 0; }' >> test.cpp
102+
g++ -std=c++17 -c test.cpp 2>&1 || echo "C++17 codecvt not supported"
103+
rm -f test.cpp test.o
104+
shell: msys2 {0}
105+
91106
- name: windows build sqlite-ai
92107
if: matrix.name == 'windows'
93108
run: make extension ${{ matrix.make && matrix.make || ''}}

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ MAKEFLAGS += -j$(CPUS)
2828
CC = gcc
2929
CXX = g++
3030
CFLAGS = -Wall -Wextra -Wno-unused-parameter -I$(SRC_DIR) -I$(LLAMA_DIR)/ggml/include -I$(LLAMA_DIR)/include
31+
CXXFLAGS = -std=c++17 -Wall -Wextra -Wno-unused-parameter -I$(SRC_DIR) -I$(LLAMA_DIR)/ggml/include -I$(LLAMA_DIR)/include
3132
LDFLAGS = -L./$(BUILD_LLAMA)/common -L./$(BUILD_LLAMA)/ggml/src -L./$(BUILD_LLAMA)/src -L./$(BUILD_WHISPER)/src -lcommon -lggml -lggml-cpu -lggml-base -lllama -lwhisper
3233
LLAMA_OPTIONS = $(LLAMA) -DLLAMA_CURL=OFF -DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=OFF -DLLAMA_BUILD_SERVER=OFF
3334
WHISPER_OPTIONS = $(WHISPER) -DWHISPER_BUILD_EXAMPLES=OFF -DWHISPER_BUILD_TESTS=OFF -DWHISPER_BUILD_SERVER=OFF
@@ -55,6 +56,9 @@ ifeq ($(PLATFORM),windows)
5556
# Create .def file for Windows
5657
DEF_FILE := $(BUILD_DIR)/ai.def
5758
STRIP = strip --strip-unneeded $@
59+
# Windows-specific flags to work around MinGW codecvt issues
60+
LLAMA_OPTIONS += -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=1 -DGGML_USE_UNICODE=0"
61+
WHISPER_OPTIONS += -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=1"
5862
else ifeq ($(PLATFORM),macos)
5963
TARGET := $(DIST_DIR)/ai.dylib
6064
LLAMA_LIBS += $(BUILD_LLAMA)/ggml/src/ggml-metal/libggml-metal.a $(BUILD_LLAMA)/ggml/src/ggml-blas/libggml-blas.a

0 commit comments

Comments
 (0)