Skip to content

Commit 2e6be2f

Browse files
bvkChaitanya Bayapuneni
andauthored
go: fix Mac OS X builds (#3310)
This commit fixes Go bindings build failure for Mac OS X (15.1) which is currently failing. Co-authored-by: Chaitanya Bayapuneni <[email protected]>
1 parent c0dc391 commit 2e6be2f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

bindings/go/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ BUILD_DIR := build_go
1515
MODELS_DIR := models
1616
EXAMPLES_DIR := $(wildcard examples/*)
1717
INCLUDE_PATH := $(abspath ../../include):$(abspath ../../ggml/include)
18-
LIBRARY_PATH := $(abspath ../../${BUILD_DIR}/src:$(abspath ../../${BUILD_DIR}/ggml/src))
18+
LIBRARY_PATH := $(abspath ../../${BUILD_DIR}/src):$(abspath ../../${BUILD_DIR}/ggml/src)
1919

2020
ifeq ($(GGML_CUDA),1)
2121
LIBRARY_PATH := $(LIBRARY_PATH):$(CUDA_PATH)/targets/$(UNAME_M)-linux/lib/
2222
BUILD_FLAGS := -ldflags "-extldflags '-lcudart -lcuda -lcublas'"
2323
endif
2424

2525
ifeq ($(UNAME_S),Darwin)
26-
EXT_LDFLAGS := -framework Foundation -framework Metal -framework MetalKit
26+
LIBRARY_PATH := $(LIBRARY_PATH):$(abspath ../../${BUILD_DIR}/ggml/src/ggml-blas):$(abspath ../../${BUILD_DIR}/ggml/src/ggml-metal)
27+
EXT_LDFLAGS := -framework Foundation -framework Metal -framework MetalKit -lggml-metal -lggml-blas
2728
endif
2829

2930
all: clean whisper examples

bindings/go/whisper.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99
// CGO
1010

1111
/*
12-
#cgo LDFLAGS: -lwhisper -lggml -lggml-base -lggml-cpu -lm -lstdc++ -fopenmp
12+
#cgo LDFLAGS: -lwhisper -lggml -lggml-base -lggml-cpu -lm -lstdc++
13+
#cgo linux LDFLAGS: -fopenmp
14+
#cgo darwin LDFLAGS: -lggml-metal -lggml-blas
1315
#cgo darwin LDFLAGS: -framework Accelerate -framework Metal -framework Foundation -framework CoreGraphics
1416
#include <whisper.h>
1517
#include <stdlib.h>

0 commit comments

Comments
 (0)