You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go : fixed Makefile for MacOS ARM 64 (ggml-org#1530)
* Fixed Makefile for MacOS ARM 64 based on ggml-org#1344 + proper ggml-metal env var setting
* conditional to fix broken non-macos compilation
* spaces -> tab
* make : fix whitespaces
---------
Co-authored-by: Georgi Gerganov <[email protected]>
Copy file name to clipboardExpand all lines: bindings/go/Makefile
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,40 @@
1
+
ifndefUNAME_S
2
+
UNAME_S := $(shell uname -s)
3
+
endif
4
+
5
+
ifndefUNAME_P
6
+
UNAME_P := $(shell uname -p)
7
+
endif
8
+
9
+
ifndefUNAME_M
10
+
UNAME_M := $(shell uname -m)
11
+
endif
12
+
13
+
GGML_METAL_PATH_RESOURCES := $(abspath ../..)
1
14
BUILD_DIR := build
2
15
MODELS_DIR := models
3
16
EXAMPLES_DIR := $(wildcard examples/*)
4
17
INCLUDE_PATH := $(abspath ../..)
5
18
LIBRARY_PATH := $(abspath ../..)
6
19
20
+
ifeq ($(UNAME_S),Darwin)
21
+
EXT_LDFLAGS := -framework Foundation -framework Metal -framework MetalKit
22
+
endif
23
+
7
24
all: clean whisper examples
8
25
9
26
whisper: mkdir
10
27
@echo Build whisper
11
28
@${MAKE} -C ../.. libwhisper.a
12
29
13
30
test: model-small whisper modtidy
31
+
ifeq ($(UNAME_S),Darwin)
32
+
@C_INCLUDE_PATH=${INCLUDE_PATH} LIBRARY_PATH=${LIBRARY_PATH} GGML_METAL_PATH_RESOURCES=${GGML_METAL_PATH_RESOURCES} go test -ldflags "-extldflags '$(EXT_LDFLAGS)'" -v .
33
+
@C_INCLUDE_PATH=${INCLUDE_PATH} LIBRARY_PATH=${LIBRARY_PATH} GGML_METAL_PATH_RESOURCES=${GGML_METAL_PATH_RESOURCES} go test -ldflags "-extldflags '$(EXT_LDFLAGS)'" -v ./pkg/whisper/...
34
+
else
14
35
@C_INCLUDE_PATH=${INCLUDE_PATH} LIBRARY_PATH=${LIBRARY_PATH} go test -v .
15
36
@C_INCLUDE_PATH=${INCLUDE_PATH} LIBRARY_PATH=${LIBRARY_PATH} go test -v ./pkg/whisper/...
0 commit comments