]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
make : fix darwin f16c flags check (#615)
authordavid raistrick <redacted>
Thu, 30 Mar 2023 17:34:45 +0000 (13:34 -0400)
committerGitHub <redacted>
Thu, 30 Mar 2023 17:34:45 +0000 (20:34 +0300)
...there was no check.  ported upstream from https://github.com/zanussbaum/gpt4all.cpp/pull/2 (I dont see any clean path for upstream patches)

Makefile

index 9cfa89f7a788955324e6ad36aa5031b58318f9c8..83a4514ef7177f4b8e3d14f92a5cd17fc6917315 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,10 @@ endif
 #       feel free to update the Makefile for your architecture and send a pull request or issue
 ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
        ifeq ($(UNAME_S),Darwin)
-               CFLAGS += -mf16c
+               F16C_M := $(shell sysctl machdep.cpu.features)
+               ifneq (,$(findstring F16C,$(F16C_M)))
+                   CFLAGS += -mf16c
+               endif
                AVX1_M := $(shell sysctl machdep.cpu.features)
                ifneq (,$(findstring FMA,$(AVX1_M)))
                        CFLAGS += -mfma