ggerganov commited on
Commit
2631afb
·
unverified ·
1 Parent(s): 3a43533

close #56 : build on FreeBSD

Browse files

Thanks to

@abelbabel
for the contribution

Files changed (3) hide show
  1. .gitignore +1 -0
  2. Makefile +8 -0
  3. ggml.c +1 -1
.gitignore CHANGED
@@ -4,6 +4,7 @@ stream
4
  *.o
5
  .cache
6
  build/
 
7
  out/
8
  .vs/
9
  .vscode/
 
4
  *.o
5
  .cache
6
  build/
7
+ build-em/
8
  out/
9
  .vs/
10
  .vscode/
Makefile CHANGED
@@ -22,12 +22,20 @@ ifeq ($(UNAME_S),Darwin)
22
  CFLAGS += -pthread
23
  CXXFLAGS += -pthread
24
  endif
 
 
 
 
25
 
26
  # Architecture specific
27
  # TODO: probably these flags need to be tweaked on some architectures
 
28
  ifeq ($(UNAME_M),x86_64)
29
  CFLAGS += -mavx -mavx2 -mfma -mf16c
30
  endif
 
 
 
31
  ifneq ($(filter arm%,$(UNAME_M)),)
32
  # Mac M1
33
  endif
 
22
  CFLAGS += -pthread
23
  CXXFLAGS += -pthread
24
  endif
25
+ ifeq ($(UNAME_S),FreeBSD)
26
+ CFLAGS += -pthread
27
+ CXXFLAGS += -pthread
28
+ endif
29
 
30
  # Architecture specific
31
  # 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
33
  ifeq ($(UNAME_M),x86_64)
34
  CFLAGS += -mavx -mavx2 -mfma -mf16c
35
  endif
36
+ ifeq ($(UNAME_M),amd64)
37
+ CFLAGS += -mavx -mavx2 -mfma -mf16c
38
+ endif
39
  ifneq ($(filter arm%,$(UNAME_M)),)
40
  # Mac M1
41
  endif
ggml.c CHANGED
@@ -2,7 +2,7 @@
2
 
3
  #if defined(_MSC_VER) || defined(__MINGW32__)
4
  #include <malloc.h> // using malloc.h with MSC/MINGW
5
- #else
6
  #include <alloca.h>
7
  #endif
8
 
 
2
 
3
  #if defined(_MSC_VER) || defined(__MINGW32__)
4
  #include <malloc.h> // using malloc.h with MSC/MINGW
5
+ #elif !defined(__FreeBSD__)
6
  #include <alloca.h>
7
  #endif
8