]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Add OpenBSD support (#314)
authorKevin Lo <redacted>
Tue, 21 Mar 2023 15:50:09 +0000 (09:50 -0600)
committerGitHub <redacted>
Tue, 21 Mar 2023 15:50:09 +0000 (17:50 +0200)
Makefile
ggml.c
utils.cpp

index 4becf6e198b58a914384ef7e0120db5e68f618bf..4b923e5752676d8997d020a359b4eebf625bd007 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,10 @@ ifeq ($(UNAME_S),NetBSD)
        CFLAGS   += -pthread
        CXXFLAGS += -pthread
 endif
+ifeq ($(UNAME_S),OpenBSD)
+       CFLAGS   += -pthread
+       CXXFLAGS += -pthread
+endif
 ifeq ($(UNAME_S),Haiku)
        CFLAGS   += -pthread
        CXXFLAGS += -pthread
diff --git a/ggml.c b/ggml.c
index f85138f3853c8c7f300ff2009a18000202523c7e..8daac351026c0ef37638c51f76b62db808e64d11 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
-#elif !defined(__FreeBSD__) && !defined(__NetBSD__)
+#elif !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
 #include <alloca.h>
 #endif
 
index 03ed9bc0658704f1bfaf59e7369c7bab6df7da51..a3bda1563b072565fe6c53050746c7e82c592079 100644 (file)
--- a/utils.cpp
+++ b/utils.cpp
@@ -12,7 +12,7 @@
 
  #if defined(_MSC_VER) || defined(__MINGW32__)
  #include <malloc.h> // using malloc.h with MSC/MINGW
- #elif !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #elif !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
  #include <alloca.h>
  #endif