Skip to content

Commit 8dadff9

Browse files
committed
deps(whisper.cpp): update to latest commit
- Update include path to add ggml - Update linker options to add gml and libgomp Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 6f5b671 commit 8dadff9

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

Makefile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RWKV_REPO?=https://github.com/donomii/go-rwkv.cpp
1616
RWKV_VERSION?=661e7ae26d442f5cfebd2a0881b44e8c55949ec6
1717

1818
# whisper.cpp version
19-
WHISPER_CPP_VERSION?=b29b3b29240aac8b71ce8e5a4360c1f1562ad66f
19+
WHISPER_CPP_VERSION?=c118733a29ad4a984015a5c08fd585086d01087a
2020

2121
# bert.cpp version
2222
BERT_VERSION?=710044b124545415f555e4260d16b146c725a6e4
@@ -36,6 +36,7 @@ export CMAKE_ARGS?=
3636

3737
CGO_LDFLAGS?=
3838
CGO_LDFLAGS_WHISPER?=
39+
CGO_LDFLAGS_WHISPER+=-lggml -lgomp
3940
CUDA_LIBPATH?=/usr/local/cuda/lib64/
4041
GO_TAGS?=
4142
BUILD_ID?=
@@ -82,6 +83,7 @@ ifeq ($(OS),Darwin)
8283
else ifneq ($(BUILD_TYPE),metal)
8384
CMAKE_ARGS+=-DGGML_METAL=OFF
8485
export GGML_NO_ACCELERATE=1
86+
export GGML_NO_METAL=1
8587
endif
8688

8789
ifeq ($(BUILD_TYPE),metal)
@@ -92,21 +94,27 @@ endif
9294

9395
ifeq ($(BUILD_TYPE),openblas)
9496
CGO_LDFLAGS+=-lopenblas
95-
export WHISPER_OPENBLAS=1
97+
export GGML_OPENBLAS=1
9698
endif
9799

98-
99100
ifeq ($(BUILD_TYPE),cublas)
100101
CGO_LDFLAGS+=-lcublas -lcudart -L$(CUDA_LIBPATH)
101102
export GGML_CUDA=1
102-
export WHISPER_CUDA=1
103103
CGO_LDFLAGS_WHISPER+=-L$(CUDA_LIBPATH)/stubs/ -lcuda -lcufft
104104
endif
105105

106106
ifeq ($(BUILD_TYPE),vulkan)
107107
CMAKE_ARGS+=-DGGML_VULKAN=1
108108
endif
109109

110+
ifneq (,$(findstring sycl,$(BUILD_TYPE)))
111+
export GGML_SYCL=1
112+
endif
113+
114+
ifeq ($(BUILD_TYPE),sycl_f16)
115+
export GGML_SYCL_F16=1
116+
endif
117+
110118
ifeq ($(BUILD_TYPE),hipblas)
111119
ROCM_HOME ?= /opt/rocm
112120
ROCM_PATH ?= /opt/rocm
@@ -115,7 +123,7 @@ ifeq ($(BUILD_TYPE),hipblas)
115123
export CC=$(ROCM_HOME)/llvm/bin/clang
116124
# llama-ggml has no hipblas support, so override it here.
117125
export STABLE_BUILD_TYPE=
118-
export WHISPER_HIPBLAS=1
126+
export GGML_HIPBLAS=1
119127
GPU_TARGETS ?= gfx900,gfx906,gfx908,gfx940,gfx941,gfx942,gfx90a,gfx1030,gfx1031,gfx1100,gfx1101
120128
AMDGPU_TARGETS ?= "$(GPU_TARGETS)"
121129
CMAKE_ARGS+=-DGGML_HIPBLAS=ON -DAMDGPU_TARGETS="$(AMDGPU_TARGETS)" -DGPU_TARGETS="$(GPU_TARGETS)"
@@ -125,12 +133,11 @@ endif
125133
ifeq ($(BUILD_TYPE),metal)
126134
CGO_LDFLAGS+=-framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders
127135
export GGML_METAL=1
128-
export WHISPER_METAL=1
129136
endif
130137

131138
ifeq ($(BUILD_TYPE),clblas)
132139
CGO_LDFLAGS+=-lOpenCL -lclblast
133-
export WHISPER_CLBLAST=1
140+
export GGML_OPENBLAS=1
134141
endif
135142

136143
# glibc-static or glibc-devel-static required
@@ -248,7 +255,7 @@ sources/whisper.cpp:
248255
cd sources/whisper.cpp && git checkout -b build $(WHISPER_CPP_VERSION) && git submodule update --init --recursive --depth 1
249256

250257
sources/whisper.cpp/libwhisper.a: sources/whisper.cpp
251-
cd sources/whisper.cpp && $(MAKE) libwhisper.a
258+
cd sources/whisper.cpp && $(MAKE) libwhisper.a libggml.a
252259

253260
get-sources: sources/go-llama.cpp sources/gpt4all sources/go-piper sources/go-rwkv.cpp sources/whisper.cpp sources/go-bert.cpp sources/go-stable-diffusion sources/go-tiny-dream
254261

@@ -792,7 +799,7 @@ backend-assets/grpc/tinydream: sources/go-tiny-dream sources/go-tiny-dream/libti
792799
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/tinydream ./backend/go/image/tinydream
793800

794801
backend-assets/grpc/whisper: sources/whisper.cpp sources/whisper.cpp/libwhisper.a backend-assets/grpc
795-
CGO_LDFLAGS="$(CGO_LDFLAGS) $(CGO_LDFLAGS_WHISPER)" C_INCLUDE_PATH=$(CURDIR)/sources/whisper.cpp LIBRARY_PATH=$(CURDIR)/sources/whisper.cpp \
802+
CGO_LDFLAGS="$(CGO_LDFLAGS) $(CGO_LDFLAGS_WHISPER)" C_INCLUDE_PATH="$(CURDIR)/sources/whisper.cpp/include:$(CURDIR)/sources/whisper.cpp/ggml/include" LIBRARY_PATH=$(CURDIR)/sources/whisper.cpp \
796803
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/whisper ./backend/go/transcribe/
797804

798805
backend-assets/grpc/local-store: backend-assets/grpc

0 commit comments

Comments
 (0)