From: Georgi Gerganov Date: Mon, 17 Oct 2022 15:09:17 +0000 (+0300) Subject: close #56 : build on FreeBSD X-Git-Tag: upstream/1.7.4~1955 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=0e858f080d0ed66907ed814623ef886dc7944272;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp close #56 : build on FreeBSD Thanks to @abelbabel for the contribution --- diff --git a/.gitignore b/.gitignore index 7f517fcd..376d5853 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ stream *.o .cache build/ +build-em/ out/ .vs/ .vscode/ diff --git a/Makefile b/Makefile index 35766e52..6552b28e 100644 --- a/Makefile +++ b/Makefile @@ -22,12 +22,20 @@ ifeq ($(UNAME_S),Darwin) CFLAGS += -pthread CXXFLAGS += -pthread endif +ifeq ($(UNAME_S),FreeBSD) + CFLAGS += -pthread + CXXFLAGS += -pthread +endif # Architecture specific # TODO: probably these flags need to be tweaked on some architectures +# feel free to update the Makefile for your architecture and send a pull request or issue ifeq ($(UNAME_M),x86_64) CFLAGS += -mavx -mavx2 -mfma -mf16c endif +ifeq ($(UNAME_M),amd64) + CFLAGS += -mavx -mavx2 -mfma -mf16c +endif ifneq ($(filter arm%,$(UNAME_M)),) # Mac M1 endif diff --git a/ggml.c b/ggml.c index 6608300f..6c585d83 100644 --- a/ggml.c +++ b/ggml.c @@ -2,7 +2,7 @@ #if defined(_MSC_VER) || defined(__MINGW32__) #include // using malloc.h with MSC/MINGW -#else +#elif !defined(__FreeBSD__) #include #endif