Spaces:
Running
Running
undef
commited on
Commit
·
760eeaa
1
Parent(s):
cc2fdee
added handling for falsely as x86_64 announced ARM Macs
Browse files
Makefile
CHANGED
|
@@ -2,11 +2,24 @@ UNAME_S := $(shell uname -s)
|
|
| 2 |
UNAME_P := $(shell uname -p)
|
| 3 |
UNAME_M := $(shell uname -m)
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
#
|
| 6 |
# Compile flags
|
| 7 |
#
|
| 8 |
|
| 9 |
-
CFLAGS = -O3 -std=c11
|
| 10 |
CXXFLAGS = -O3 -std=c++11
|
| 11 |
LDFLAGS =
|
| 12 |
|
|
|
|
| 2 |
UNAME_P := $(shell uname -p)
|
| 3 |
UNAME_M := $(shell uname -m)
|
| 4 |
|
| 5 |
+
# Mac OS + Arm can report x86_64
|
| 6 |
+
# ref: https://github.com/ggerganov/whisper.cpp/issues/66#issuecomment-1282546789
|
| 7 |
+
ifeq ($(UNAME_S),Darwin)
|
| 8 |
+
ifneq ($(UNAME_P),arm)
|
| 9 |
+
SYSCTL_M := $(shell sysctl -n hw.optional.arm64)
|
| 10 |
+
ifeq ($(SYSCTL_M),1)
|
| 11 |
+
UNAME_P := arm
|
| 12 |
+
UNAME_M := arm64
|
| 13 |
+
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)
|
| 14 |
+
endif
|
| 15 |
+
endif
|
| 16 |
+
endif
|
| 17 |
+
|
| 18 |
#
|
| 19 |
# Compile flags
|
| 20 |
#
|
| 21 |
|
| 22 |
+
CFLAGS = -O3 -std=c11
|
| 23 |
CXXFLAGS = -O3 -std=c++11
|
| 24 |
LDFLAGS =
|
| 25 |
|