@@ -16,7 +16,7 @@ RWKV_REPO?=https://github.com/donomii/go-rwkv.cpp
1616RWKV_VERSION? =661e7ae26d442f5cfebd2a0881b44e8c55949ec6
1717
1818#  whisper.cpp version
19- WHISPER_CPP_VERSION? =b29b3b29240aac8b71ce8e5a4360c1f1562ad66f 
19+ WHISPER_CPP_VERSION? =c118733a29ad4a984015a5c08fd585086d01087a 
2020
2121#  bert.cpp version
2222BERT_VERSION? =710044b124545415f555e4260d16b146c725a6e4
@@ -36,6 +36,7 @@ export CMAKE_ARGS?=
3636
3737CGO_LDFLAGS? =
3838CGO_LDFLAGS_WHISPER? =
39+ CGO_LDFLAGS_WHISPER+ =-lggml -lgomp
3940CUDA_LIBPATH? =/usr/local/cuda/lib64/
4041GO_TAGS? =
4142BUILD_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
9395ifeq  ($(BUILD_TYPE ) ,openblas)
9496	CGO_LDFLAGS+=-lopenblas
95- 	export WHISPER_OPENBLAS =1
97+ 	export GGML_OPENBLAS =1
9698endif 
9799
98- 
99100ifeq  ($(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
104104endif 
105105
106106ifeq  ($(BUILD_TYPE ) ,vulkan)
107107	CMAKE_ARGS+=-DGGML_VULKAN=1
108108endif 
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+ 
110118ifeq  ($(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
125133ifeq  ($(BUILD_TYPE ) ,metal)
126134	CGO_LDFLAGS+=-framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders
127135	export GGML_METAL=1
128- 	export WHISPER_METAL=1
129136endif 
130137
131138ifeq  ($(BUILD_TYPE ) ,clblas)
132139	CGO_LDFLAGS+=-lOpenCL -lclblast
133- 	export WHISPER_CLBLAST =1
140+ 	export GGML_OPENBLAS =1
134141endif 
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
250257sources/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
253260get-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) " " $( GO_TAGS) " 
793800
794801backend-assets/grpc/whisper : sources/whisper.cpp sources/whisper.cpp/libwhisper.a backend-assets/grpc
795- 	CGO_LDFLAGS=" $( CGO_LDFLAGS) $( CGO_LDFLAGS_WHISPER) " $(CURDIR ) /sources/whisper.cpp LIBRARY_PATH=$(CURDIR ) /sources/whisper.cpp \ 
802+ 	CGO_LDFLAGS=" $( CGO_LDFLAGS) $( CGO_LDFLAGS_WHISPER) " " $( CURDIR) /include: $( CURDIR ) /sources/whisper.cpp/ggml/include " $(CURDIR ) /sources/whisper.cpp \ 
796803	$(GOCMD )  build -ldflags " $( LD_FLAGS) " " $( GO_TAGS) " 
797804
798805backend-assets/grpc/local-store : backend-assets/grpc
0 commit comments