Skip to content

Commit 61c8e86

Browse files
committed
close ggml-org#56 : build on FreeBSD
Thanks to @abelbabel for the contribution
1 parent 7840d2c commit 61c8e86

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ stream
44
*.o
55
.cache
66
build/
7+
build-em/
78
out/
89
.vs/
910
.vscode/

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ ifeq ($(UNAME_S),Darwin)
2222
CFLAGS += -pthread
2323
CXXFLAGS += -pthread
2424
endif
25+
ifeq ($(UNAME_S),FreeBSD)
26+
CFLAGS += -pthread
27+
CXXFLAGS += -pthread
28+
endif
2529

2630
# Architecture specific
2731
# TODO: probably these flags need to be tweaked on some architectures
32+
# feel free to update the Makefile for your architecture and send a pull request or issue
2833
ifeq ($(UNAME_M),x86_64)
2934
CFLAGS += -mavx -mavx2 -mfma -mf16c
3035
endif
36+
ifeq ($(UNAME_M),amd64)
37+
CFLAGS += -mavx -mavx2 -mfma -mf16c
38+
endif
3139
ifneq ($(filter arm%,$(UNAME_M)),)
3240
# Mac M1
3341
endif

ggml.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#if defined(_MSC_VER) || defined(__MINGW32__)
44
#include <malloc.h> // using malloc.h with MSC/MINGW
5-
#else
5+
#elif !defined(__FreeBSD__)
66
#include <alloca.h>
77
#endif
88

0 commit comments

Comments
 (0)