Skip to content

Commit 9ae3e67

Browse files
committed
fix(whisper.cpp): Add stubs and -lcuda
1 parent 0eb0ac7 commit 9ae3e67

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

+5-2
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?=37a709f6558c6d9783199e2b8cbb136e1c41d346
19+
WHISPER_CPP_VERSION?=a56f435fd475afd7edf02bfbf9f8c77f527198c2
2020

2121
# bert.cpp version
2222
BERT_VERSION?=6abe312cded14042f6b7c3cd8edf082713334a4d
@@ -35,6 +35,7 @@ export STABLE_BUILD_TYPE?=$(BUILD_TYPE)
3535
export CMAKE_ARGS?=
3636

3737
CGO_LDFLAGS?=
38+
CGO_LDFLAGS_WHISPER?=
3839
CUDA_LIBPATH?=/usr/local/cuda/lib64/
3940
GO_TAGS?=
4041
BUILD_ID?=git
@@ -88,10 +89,12 @@ ifeq ($(BUILD_TYPE),openblas)
8889
export WHISPER_OPENBLAS=1
8990
endif
9091

92+
9193
ifeq ($(BUILD_TYPE),cublas)
9294
CGO_LDFLAGS+=-lcublas -lcudart -L$(CUDA_LIBPATH)
9395
export LLAMA_CUBLAS=1
9496
export WHISPER_CUBLAS=1
97+
CGO_LDFLAGS_WHISPER+=-L$(CUDA_LIBPATH)/stubs/ -lcuda
9598
endif
9699

97100
ifeq ($(BUILD_TYPE),hipblas)
@@ -515,7 +518,7 @@ backend-assets/grpc/tinydream: sources/go-tiny-dream sources/go-tiny-dream/libti
515518
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/tinydream ./backend/go/image/tinydream
516519

517520
backend-assets/grpc/whisper: sources/whisper.cpp sources/whisper.cpp/libwhisper.a backend-assets/grpc
518-
CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=$(CURDIR)/sources/whisper.cpp LIBRARY_PATH=$(CURDIR)/sources/whisper.cpp \
521+
CGO_LDFLAGS="$(CGO_LDFLAGS) $(CGO_LDFLAGS_WHISPER)" C_INCLUDE_PATH=$(CURDIR)/sources/whisper.cpp LIBRARY_PATH=$(CURDIR)/sources/whisper.cpp \
519522
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/whisper ./backend/go/transcribe/
520523

521524
grpcs: prepare $(GRPC_BACKENDS)

0 commit comments

Comments
 (0)