Skip to content

Commit aaae512

Browse files
committed
Bundle ggml-cpp.h for Metal runtime compile
ggml-backend-meta.cpp #includes "ggml-cpp.h", which wasn't in the bundle because no previously bundled source needed it. Without this, on macOS the on-the-fly metal dylib compile fails with: ~/.llamafile/v/X.Y.Z/ggml-backend-meta.cpp:6:10: fatal error: 'ggml-cpp.h' file not found Yoink + extract-map + LLAMAFILE_METAL_SOURCES updated.
1 parent 2255239 commit aaae512

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

llamafile/BUILD.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ LLAMAFILE_METAL_SOURCES := \
242242
o/$(MODE)/llama.cpp/ggml/include/ggml-cpu.h.zip.o \
243243
o/$(MODE)/llama.cpp/ggml/include/ggml-alloc.h.zip.o \
244244
o/$(MODE)/llama.cpp/ggml/include/ggml-backend.h.zip.o \
245+
o/$(MODE)/llama.cpp/ggml/include/ggml-cpp.h.zip.o \
245246
o/$(MODE)/llama.cpp/ggml/include/ggml-metal.h.zip.o \
246247
o/$(MODE)/llama.cpp/ggml/src/ggml-impl.h.zip.o \
247248
o/$(MODE)/llama.cpp/ggml/src/ggml-common.h.zip.o \

llamafile/metal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ __static_yoink("llama.cpp/ggml/include/gguf.h");
6464
__static_yoink("llama.cpp/ggml/include/ggml-cpu.h");
6565
__static_yoink("llama.cpp/ggml/include/ggml-alloc.h");
6666
__static_yoink("llama.cpp/ggml/include/ggml-backend.h");
67+
__static_yoink("llama.cpp/ggml/include/ggml-cpp.h");
6768
__static_yoink("llama.cpp/ggml/include/ggml-metal.h");
6869
__static_yoink("llama.cpp/ggml/src/ggml-impl.h");
6970
__static_yoink("llama.cpp/ggml/src/ggml-common.h");
@@ -97,6 +98,7 @@ static const struct MetalSource {
9798
{"/zip/llama.cpp/ggml/include/ggml-cpu.h", "ggml-cpu.h"},
9899
{"/zip/llama.cpp/ggml/include/ggml-alloc.h", "ggml-alloc.h"},
99100
{"/zip/llama.cpp/ggml/include/ggml-backend.h", "ggml-backend.h"},
101+
{"/zip/llama.cpp/ggml/include/ggml-cpp.h", "ggml-cpp.h"},
100102
{"/zip/llama.cpp/ggml/include/ggml-metal.h", "ggml-metal.h"},
101103
{"/zip/llama.cpp/ggml/src/ggml-impl.h", "ggml-impl.h"},
102104
{"/zip/llama.cpp/ggml/src/ggml-common.h", "ggml-common.h"},

0 commit comments

Comments
 (0)