]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
Allow building with Accelerate for x86_64 Macs (#123)
authorSyed Jafri <redacted>
Wed, 2 Nov 2022 16:00:19 +0000 (10:00 -0600)
committerGitHub <redacted>
Wed, 2 Nov 2022 16:00:19 +0000 (18:00 +0200)
* Cross compile windows

* set env properly

* rm log

* fix review

* Add back space

* Don't force architecture

* Allow building x86_64 with accelerate

Makefile

index ff00a3232b95cb6559fb129bef871a933a22d662..c20bd551facd4739aff410614ad754151b13cdad 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,8 +16,8 @@ ifeq ($(UNAME_S),Darwin)
        ifneq ($(UNAME_P),arm)
                SYSCTL_M := $(shell sysctl -n hw.optional.arm64)
                ifeq ($(SYSCTL_M),1)
-                       UNAME_P := arm
-                       UNAME_M := arm64
+                       UNAME_P := arm
+                       UNAME_M := arm64
                        warn := $(warning Your arch is announced as x86_64, but it seems to actually be ARM64. Not fixing that can lead to bad performance. For more info see: https://github.com/ggerganov/whisper.cpp/issues/66\#issuecomment-1282546789)
                endif
        endif
@@ -55,7 +55,7 @@ endif
 ifeq ($(UNAME_M),amd64)
        CFLAGS += -mavx -mavx2 -mfma -mf16c
 endif
-ifneq ($(filter arm%,$(UNAME_M)),)
+ifndef WHISPER_NO_ACCELERATE
        # Mac M1 - include Accelerate framework
        ifeq ($(UNAME_S),Darwin)
                CFLAGS  += -DGGML_USE_ACCELERATE