]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
close #56 : build on FreeBSD
authorGeorgi Gerganov <redacted>
Mon, 17 Oct 2022 15:09:17 +0000 (18:09 +0300)
committerGeorgi Gerganov <redacted>
Mon, 17 Oct 2022 15:10:16 +0000 (18:10 +0300)
Thanks to @abelbabel for the contribution

.gitignore
Makefile
ggml.c

index 7f517fcd6d9bd218a978cb8019bc51b355a7c971..376d585339b23083e09d147b339dbb4e538c8260 100644 (file)
@@ -4,6 +4,7 @@ stream
 *.o
 .cache
 build/
+build-em/
 out/
 .vs/
 .vscode/
index 35766e52fbbfe39f41bbf9e49d41a442e73c66cd..6552b28e7d82334d4cd851ca24b1a7f17c1fdb72 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -22,12 +22,20 @@ ifeq ($(UNAME_S),Darwin)
        CFLAGS   += -pthread
        CXXFLAGS += -pthread
 endif
+ifeq ($(UNAME_S),FreeBSD)
+       CFLAGS   += -pthread
+       CXXFLAGS += -pthread
+endif
 
 # Architecture specific
 # TODO: probably these flags need to be tweaked on some architectures
+#       feel free to update the Makefile for your architecture and send a pull request or issue
 ifeq ($(UNAME_M),x86_64)
        CFLAGS += -mavx -mavx2 -mfma -mf16c
 endif
+ifeq ($(UNAME_M),amd64)
+       CFLAGS += -mavx -mavx2 -mfma -mf16c
+endif
 ifneq ($(filter arm%,$(UNAME_M)),)
        # Mac M1
 endif
diff --git a/ggml.c b/ggml.c
index 6608300f7864b194d0bb7c41cc18444f7c2f5b69..6c585d831bb672653b58147965da7f6f326f9a7b 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -2,7 +2,7 @@
 
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #include <malloc.h> // using malloc.h with MSC/MINGW
-#else
+#elif !defined(__FreeBSD__)
 #include <alloca.h>
 #endif