]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Add NetBSD support. (#90)
authorThomas Klausner <redacted>
Mon, 13 Mar 2023 16:40:54 +0000 (17:40 +0100)
committerGitHub <redacted>
Mon, 13 Mar 2023 16:40:54 +0000 (18:40 +0200)
Makefile
ggml.c
utils.cpp

index 8388c290d75ceff7ef8ba7424bc27608e6574c79..1601079a48685c6058a4bb198b202ecacd40f30a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -48,6 +48,10 @@ ifeq ($(UNAME_S),FreeBSD)
        CFLAGS   += -pthread
        CXXFLAGS += -pthread
 endif
+ifeq ($(UNAME_S),NetBSD)
+       CFLAGS   += -pthread
+       CXXFLAGS += -pthread
+endif
 ifeq ($(UNAME_S),Haiku)
        CFLAGS   += -pthread
        CXXFLAGS += -pthread
diff --git a/ggml.c b/ggml.c
index 7b0b456f872cf35e16e4e7573dc12a143eaa53ad..58a4c9b6dfa2be68a1949c46f63d685d661534fe 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__)
+#elif !defined(__FreeBSD__) && !defined(__NetBSD__)
 #include <alloca.h>
 #endif
 
index b340bd61b39e1725aced072faa9fb7efc4c51b2a..54217f02f5c366aaa1e03045b245e8f72abf028f 100644 (file)
--- a/utils.cpp
+++ b/utils.cpp
@@ -11,7 +11,7 @@
 
  #if defined(_MSC_VER) || defined(__MINGW32__)
  #include <malloc.h> // using malloc.h with MSC/MINGW
- #elif !defined(__FreeBSD__)
+ #elif !defined(__FreeBSD__) && !defined(__NetBSD__)
  #include <alloca.h>
  #endif