Skip to content

Commit 1ad87ef

Browse files
author
Daniele Briggi
committed
fix(makefile): variables declaration before usage
1 parent c29ef75 commit 1ad87ef

File tree

2 files changed

+49
-39
lines changed

2 files changed

+49
-39
lines changed

.github/workflows/main.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
include:
18-
- name: linux-vulkan
19-
os: ubuntu-latest
20-
arch: x86_64
21-
make: LLAMA="-DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON"
18+
# - name: linux-vulkan
19+
# os: ubuntu-latest
20+
# arch: x86_64
21+
# 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
27-
- name: android
28-
os: ubuntu-latest
29-
arch: arm64-v8a
30-
make: PLATFORM=android ARCH=arm64-v8a
31-
- name: android
32-
os: ubuntu-latest
33-
arch: x86_64
34-
make: PLATFORM=android ARCH=x86_64
35-
sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
36-
- name: ios
37-
os: macos-latest
38-
make: PLATFORM=ios
39-
- name: isim
40-
os: macos-latest
41-
make: PLATFORM=isim
24+
# - name: windows
25+
# os: windows-latest
26+
# arch: x86_64
27+
# - name: android
28+
# os: ubuntu-latest
29+
# arch: arm64-v8a
30+
# make: PLATFORM=android ARCH=arm64-v8a
31+
# - name: android
32+
# os: ubuntu-latest
33+
# arch: x86_64
34+
# make: PLATFORM=android ARCH=x86_64
35+
# sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
36+
# - name: ios
37+
# os: macos-latest
38+
# make: PLATFORM=ios
39+
# - name: isim
40+
# os: macos-latest
41+
# make: PLATFORM=isim
4242

4343
defaults:
4444
run:
@@ -92,7 +92,7 @@ jobs:
9292
if: matrix.name == 'windows'
9393
run: make extension ${{ matrix.make && matrix.make || ''}}
9494
shell: msys2 {0}
95-
95+
9696
- name: build sqlite-ai
9797
if: matrix.name != 'windows'
9898
run: make extension ${{ matrix.make && matrix.make || ''}}
@@ -101,7 +101,6 @@ jobs:
101101
if: matrix.name == 'macos'
102102
run: brew link sqlite --force
103103

104-
105104
- name: android setup test environment
106105
if: matrix.name == 'android' && matrix.arch != 'arm64-v8a'
107106
run: |
@@ -149,6 +148,15 @@ jobs:
149148
run: make test
150149
shell: msys2 {0}
151150

151+
- name: check whisper CoreML linking (macOS)
152+
if: matrix.name == 'macos'
153+
run: |
154+
echo "Checking if whisper CoreML symbols are present..."
155+
nm -D dist/ai.dylib | grep -i coreml || echo "CoreML symbols not found in binary"
156+
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
159+
152160
- name: test sqlite-ai
153161
if: matrix.name == 'linux' || matrix.name == 'macos'
154162
run: make test

Makefile

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,6 @@ endif
2424
# Speed up builds by using all available CPU cores
2525
MAKEFLAGS += -j$(CPUS)
2626

27-
# Compiler and flags
28-
CC = gcc
29-
CXX = g++
30-
CFLAGS = -Wall -Wextra -Wno-unused-parameter -I$(SRC_DIR) -I$(LLAMA_DIR)/ggml/include -I$(LLAMA_DIR)/include -I$(WHISPER_DIR)/include -I$(MINIAUDIO_DIR)
31-
LDFLAGS = $(LLAMA_LDFLAGS) $(WHISPER_LDFLAGS) $(MINIAUDIO_LDFLAGS)
32-
LLAMA_OPTIONS = $(LLAMA) -DLLAMA_CURL=OFF -DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=OFF -DLLAMA_BUILD_SERVER=OFF
33-
WHISPER_OPTIONS = $(WHISPER) -DWHISPER_BUILD_EXAMPLES=OFF -DWHISPER_BUILD_TESTS=OFF -DWHISPER_BUILD_SERVER=OFF
34-
MINIAUDIO_OPTIONS = -DMINIAUDIO_BUILD_EXAMPLES=OFF -DMINIAUDIO_BUILD_TESTS=OFF
35-
36-
# Module-specific linking flags
37-
LLAMA_LDFLAGS = -L./$(BUILD_LLAMA)/common -L./$(BUILD_LLAMA)/ggml/src -L./$(BUILD_LLAMA)/src -lcommon -lggml -lggml-cpu -lggml-base -lllama
38-
WHISPER_LDFLAGS = -L./$(BUILD_WHISPER)/src -lwhisper
39-
MINIAUDIO_LDFLAGS = -L./$(BUILD_MINIAUDIO) -lminiaudio
40-
4127
# Directories
4228
SRC_DIR = src
4329
DIST_DIR = dist
@@ -50,6 +36,21 @@ BUILD_LLAMA = $(BUILD_DIR)/llama.cpp
5036
BUILD_WHISPER = $(BUILD_DIR)/whisper.cpp
5137
BUILD_MINIAUDIO = $(BUILD_DIR)/miniaudio
5238

39+
# Compiler and flags
40+
CC = gcc
41+
CXX = g++
42+
CFLAGS = -Wall -Wextra -Wno-unused-parameter -I$(SRC_DIR) -I$(LLAMA_DIR)/ggml/include -I$(LLAMA_DIR)/include -I$(WHISPER_DIR)/include -I$(MINIAUDIO_DIR)
43+
LLAMA_OPTIONS = -DLLAMA_CURL=OFF -DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=OFF -DLLAMA_BUILD_SERVER=OFF
44+
WHISPER_OPTIONS = -DWHISPER_BUILD_EXAMPLES=OFF -DWHISPER_BUILD_TESTS=OFF -DWHISPER_BUILD_SERVER=OFF
45+
MINIAUDIO_OPTIONS = -DMINIAUDIO_BUILD_EXAMPLES=OFF -DMINIAUDIO_BUILD_TESTS=OFF
46+
47+
# Module-specific linking flags
48+
LLAMA_LDFLAGS = -L./$(BUILD_LLAMA)/common -L./$(BUILD_LLAMA)/ggml/src -L./$(BUILD_LLAMA)/src -lcommon -lggml -lggml-cpu -lggml-base -lllama
49+
WHISPER_LDFLAGS = -L./$(BUILD_WHISPER)/src -lwhisper
50+
MINIAUDIO_LDFLAGS = -L./$(BUILD_MINIAUDIO) -lminiaudio
51+
52+
LDFLAGS = $(LLAMA_LDFLAGS) $(WHISPER_LDFLAGS) $(MINIAUDIO_LDFLAGS)
53+
5354
# Files
5455
SRC_FILES = $(wildcard $(SRC_DIR)/*.c)
5556
OBJ_FILES = $(patsubst %.c, $(BUILD_DIR)/%.o, $(notdir $(SRC_FILES)))
@@ -67,10 +68,11 @@ ifeq ($(PLATFORM),windows)
6768
else ifeq ($(PLATFORM),macos)
6869
TARGET := $(DIST_DIR)/ai.dylib
6970
LLAMA_LIBS += $(BUILD_LLAMA)/ggml/src/ggml-metal/libggml-metal.a $(BUILD_LLAMA)/ggml/src/ggml-blas/libggml-blas.a
71+
WHISPER_LIBS += $(BUILD_WHISPER)/src/libwhisper.coreml.a
7072
LDFLAGS += -arch x86_64 -arch arm64 -L./$(BUILD_LLAMA)/ggml/src/ggml-metal -lggml-metal -L./$(BUILD_LLAMA)/ggml/src/ggml-blas -lggml-blas -framework Metal -framework Foundation -framework CoreFoundation -framework QuartzCore -framework Accelerate -framework CoreML -dynamiclib -undefined dynamic_lookup
7173
CFLAGS += -arch x86_64 -arch arm64
7274
LLAMA_OPTIONS += -DBUILD_SHARED_LIBS=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
73-
WHISPER_OPTIONS += -DBUILD_SHARED_LIBS=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DWHISPER_COREML=ON
75+
WHISPER_OPTIONS += -DBUILD_SHARED_LIBS=OFF -DWHISPER_SHARED_LIB=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DWHISPER_COREML=ON
7476
MINIAUDIO_OPTIONS += -DBUILD_SHARED_LIBS=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
7577
STRIP = strip -x -S $@
7678
else ifeq ($(PLATFORM),android)

0 commit comments

Comments
 (0)