summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lo <kevlo@kevlo.org>2023-03-21 09:50:09 -0600
committerGitHub <noreply@github.com>2023-03-21 17:50:09 +0200
commit715d292ee0e34d27f27af43d7feaad1f1344981d (patch)
tree3a652a866b16c3cef07ec3ead3c8a55b9626d8b6
parentc98ae02668a25916954b1653e25a5a35ca048d63 (diff)
Add OpenBSD support (#314)
-rw-r--r--Makefile4
-rw-r--r--ggml.c2
-rw-r--r--utils.cpp2
3 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4becf6e1..4b923e57 100644
--- 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 f85138f3..8daac351 100644
--- 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
diff --git a/utils.cpp b/utils.cpp
index 03ed9bc0..a3bda156 100644
--- 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