BVK Chaitanya Chaitanya Bayapuneni commited on
Commit
2fd8067
·
unverified ·
1 Parent(s): ebe9052

go: fix Mac OS X builds (#3310)

Browse files

This commit fixes Go bindings build failure for Mac OS X (15.1) which is currently failing.

Co-authored-by: Chaitanya Bayapuneni <[email protected]>

Files changed (2) hide show
  1. bindings/go/Makefile +3 -2
  2. bindings/go/whisper.go +3 -1
bindings/go/Makefile CHANGED
@@ -15,7 +15,7 @@ BUILD_DIR := build_go
15
  MODELS_DIR := models
16
  EXAMPLES_DIR := $(wildcard examples/*)
17
  INCLUDE_PATH := $(abspath ../../include):$(abspath ../../ggml/include)
18
- LIBRARY_PATH := $(abspath ../../${BUILD_DIR}/src:$(abspath ../../${BUILD_DIR}/ggml/src))
19
 
20
  ifeq ($(GGML_CUDA),1)
21
  LIBRARY_PATH := $(LIBRARY_PATH):$(CUDA_PATH)/targets/$(UNAME_M)-linux/lib/
@@ -23,7 +23,8 @@ ifeq ($(GGML_CUDA),1)
23
  endif
24
 
25
  ifeq ($(UNAME_S),Darwin)
26
- EXT_LDFLAGS := -framework Foundation -framework Metal -framework MetalKit
 
27
  endif
28
 
29
  all: clean whisper examples
 
15
  MODELS_DIR := models
16
  EXAMPLES_DIR := $(wildcard examples/*)
17
  INCLUDE_PATH := $(abspath ../../include):$(abspath ../../ggml/include)
18
+ LIBRARY_PATH := $(abspath ../../${BUILD_DIR}/src):$(abspath ../../${BUILD_DIR}/ggml/src)
19
 
20
  ifeq ($(GGML_CUDA),1)
21
  LIBRARY_PATH := $(LIBRARY_PATH):$(CUDA_PATH)/targets/$(UNAME_M)-linux/lib/
 
23
  endif
24
 
25
  ifeq ($(UNAME_S),Darwin)
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
28
  endif
29
 
30
  all: clean whisper examples
bindings/go/whisper.go CHANGED
@@ -9,7 +9,9 @@ import (
9
  // CGO
10
 
11
  /*
12
- #cgo LDFLAGS: -lwhisper -lggml -lggml-base -lggml-cpu -lm -lstdc++ -fopenmp
 
 
13
  #cgo darwin LDFLAGS: -framework Accelerate -framework Metal -framework Foundation -framework CoreGraphics
14
  #include <whisper.h>
15
  #include <stdlib.h>
 
9
  // CGO
10
 
11
  /*
12
+ #cgo LDFLAGS: -lwhisper -lggml -lggml-base -lggml-cpu -lm -lstdc++
13
+ #cgo linux LDFLAGS: -fopenmp
14
+ #cgo darwin LDFLAGS: -lggml-metal -lggml-blas
15
  #cgo darwin LDFLAGS: -framework Accelerate -framework Metal -framework Foundation -framework CoreGraphics
16
  #include <whisper.h>
17
  #include <stdlib.h>