diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c50e2ae..1bfd14b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -426,6 +426,8 @@ set(TARGET whisper) add_library(${TARGET} ggml.h ggml.c + ggml-alloc.h + ggml-alloc.c ${GGML_CUDA_SOURCES} ${GGML_OPENCL_SOURCES} whisper.h diff --git a/Makefile b/Makefile index 7aaade97..2df51116 100644 --- a/Makefile +++ b/Makefile @@ -184,6 +184,8 @@ endif ifndef WHISPER_NO_METAL ifeq ($(UNAME_S),Darwin) + WHISPER_METAL := 1 + CXXFLAGS += -DGGML_USE_METAL LDFLAGS += -framework Foundation -framework Metal -framework MetalKit endif @@ -315,7 +317,7 @@ whisper-encoder-impl.o: coreml/whisper-encoder-impl.m coreml/whisper-encoder-imp WHISPER_OBJ += whisper.o whisper-encoder.o whisper-encoder-impl.o endif -ifndef WHISPER_NO_METAL +ifdef WHISPER_METAL ggml-metal.o: ggml-metal.m ggml-metal.h $(CC) $(CFLAGS) -c $< -o $@ diff --git a/examples/talk-llama/CMakeLists.txt b/examples/talk-llama/CMakeLists.txt index cbdfb417..af5b5473 100644 --- a/examples/talk-llama/CMakeLists.txt +++ b/examples/talk-llama/CMakeLists.txt @@ -7,7 +7,7 @@ if (WHISPER_SDL2) # TODO: this is temporary # need to export ggml symbols for MSVC, but too lazy .. - add_executable(${TARGET} talk-llama.cpp llama.cpp ../common.cpp ../common-sdl.cpp ../../ggml.c ../../whisper.cpp) + add_executable(${TARGET} talk-llama.cpp llama.cpp ../common.cpp ../common-sdl.cpp ../../ggml.c ../../ggml-alloc.c ../../whisper.cpp) target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS} ../../) target_link_libraries(${TARGET} PRIVATE ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})