File tree Expand file tree Collapse file tree 3 files changed +30
-9
lines changed
Expand file tree Collapse file tree 3 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 2121 # make: LLAMA="-DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON"
2222 - name : macos
2323 os : macos-latest
24- # - name: windows
25- # os: windows-latest
26- # arch: x86_64
24+ - name : windows
25+ os : windows-latest
26+ arch : x86_64
2727 # - name: android
2828 # os: ubuntu-latest
2929 # arch: arm64-v8a
@@ -152,10 +152,15 @@ jobs:
152152 if : matrix.name == 'macos'
153153 run : |
154154 echo "Checking if whisper CoreML symbols are present..."
155- nm -D dist/ai.dylib | grep -i coreml || echo "CoreML symbols not found in binary"
155+ echo "=== Dynamic symbols in ai.dylib ==="
156+ nm -D dist/ai.dylib | grep -i coreml || echo "CoreML symbols not found in dynamic symbol table"
157+ echo "=== All symbols in ai.dylib ==="
158+ nm dist/ai.dylib | grep -i coreml || echo "CoreML symbols not found in symbol table"
159+ echo "=== Linked frameworks ==="
156160 otool -L dist/ai.dylib | grep CoreML || echo "CoreML framework not linked"
157- nm build/whisper.cpp/src/libwhisper.a | grep coreml
158- nm build/whisper.cpp/src/libwhisper.coreml.a | grep coreml
161+ echo "=== CoreML symbols in whisper libraries ==="
162+ nm build/whisper.cpp/src/libwhisper.a | grep coreml || echo "No CoreML symbols in libwhisper.a"
163+ nm build/whisper.cpp/src/libwhisper.coreml.a | grep coreml || echo "No CoreML symbols in libwhisper.coreml.a"
159164
160165 - name : test sqlite-ai
161166 if : matrix.name == 'linux' || matrix.name == 'macos'
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ MINIAUDIO_LIBS = $(BUILD_MINIAUDIO)/libminiaudio.a
6161# Platform-specific settings
6262ifeq ($(PLATFORM ) ,windows)
6363 TARGET := $(DIST_DIR)/ai.dll
64- LDFLAGS = -L./$(BUILD_LLAMA)/common -L./$(BUILD_LLAMA)/ggml/src -L./$(BUILD_LLAMA)/src -L./$(BUILD_WHISPER)/src -L./$(BUILD_MINIAUDIO) -l:libllama.a -l:libwhisper.a -l:libminiaudio.a -l:libcommon.a -l:ggml.a -l:ggml-cpu.a -l:ggml-base.a -fopenmp -static-libgcc -static-libstdc++ -shared
64+ LDFLAGS = -L./$(BUILD_LLAMA)/common -L./$(BUILD_LLAMA)/ggml/src -L./$(BUILD_LLAMA)/src -L./$(BUILD_WHISPER)/src -L./$(BUILD_MINIAUDIO) -l:libllama.a -l:libwhisper.a -l:libminiaudio.a -l:libcommon.a -l:ggml.a -l:ggml-cpu.a -l:ggml-base.a -fopenmp -static-libgcc -static-libstdc++ -shared -lbcrypt
6565 # Create .def file for Windows
6666 DEF_FILE := $(BUILD_DIR)/ai.def
6767 STRIP = strip --strip-unneeded $@
Original file line number Diff line number Diff line change 1414#include <ctype.h>
1515#include <stdlib.h>
1616#include <string.h>
17+ #include <time.h>
1718
1819#ifdef _WIN32
1920#include <windows.h>
2930#endif
3031#endif
3132
33+ // Define TIME_UTC if not available (for non-Windows platforms)
34+ #ifndef TIME_UTC
35+ #define TIME_UTC 1
36+ #endif
37+
3238#ifndef SQLITE_CORE
3339SQLITE_EXTENSION_INIT3
3440#endif
@@ -369,15 +375,25 @@ int ai_uuid_v7_generate (uint8_t value[UUID_LEN]) {
369375 #endif
370376
371377 // get current timestamp in ms
378+ uint64_t timestamp ;
379+ #if defined(_WIN32 )
380+ // Use GetSystemTimeAsFileTime for Windows/MinGW
381+ FILETIME ft ;
382+ GetSystemTimeAsFileTime (& ft );
383+ uint64_t t = ((uint64_t )ft .dwHighDateTime << 32 ) | ft .dwLowDateTime ;
384+ // Convert FILETIME (100-ns intervals since Jan 1, 1601) to ms since Unix epoch
385+ timestamp = (t / 10000ULL ) - 11644473600000ULL ;
386+ #else
372387 struct timespec ts ;
373- #ifdef __ANDROID__
388+ #if defined( __ANDROID__ )
374389 if (clock_gettime (CLOCK_REALTIME , & ts ) != 0 ) return -1 ;
375390 #else
376391 if (timespec_get (& ts , TIME_UTC ) == 0 ) return -1 ;
377392 #endif
393+ timestamp = (uint64_t )ts .tv_sec * 1000 + ts .tv_nsec / 1000000 ;
394+ #endif
378395
379396 // add timestamp part to UUID
380- uint64_t timestamp = (uint64_t )ts .tv_sec * 1000 + ts .tv_nsec / 1000000 ;
381397 value [0 ] = (timestamp >> 40 ) & 0xFF ;
382398 value [1 ] = (timestamp >> 32 ) & 0xFF ;
383399 value [2 ] = (timestamp >> 24 ) & 0xFF ;
You can’t perform that action at this time.
0 commit comments