]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
added handling for falsely as x86_64 announced ARM Macs
authorundef <redacted>
Tue, 18 Oct 2022 23:01:53 +0000 (01:01 +0200)
committerundef <redacted>
Tue, 18 Oct 2022 23:01:53 +0000 (01:01 +0200)
Makefile

index 3e5c9a4c16b14df28b6db9676097d2d478b371e5..931e2d114ec483210b11db20d8906ea67664b9b9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,24 @@ UNAME_S := $(shell uname -s)
 UNAME_P := $(shell uname -p)
 UNAME_M := $(shell uname -m)
 
+# Mac OS + Arm can report x86_64
+# ref: https://github.com/ggerganov/whisper.cpp/issues/66#issuecomment-1282546789
+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
+                       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
+endif
+
 #
 # Compile flags
 #
 
-CFLAGS   = -O3 -std=c11  
+CFLAGS   = -O3 -std=c11
 CXXFLAGS = -O3 -std=c++11
 LDFLAGS  =