fix compilation on haiku
This commit is contained in:
parent
47afb93c3c
commit
04a16bbf11
21
Makefile
21
Makefile
@ -45,6 +45,10 @@ ifeq ($(UNAME_S),FreeBSD)
|
|||||||
CFLAGS += -pthread
|
CFLAGS += -pthread
|
||||||
CXXFLAGS += -pthread
|
CXXFLAGS += -pthread
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(UNAME_S),Haiku)
|
||||||
|
CFLAGS += -pthread
|
||||||
|
CXXFLAGS += -pthread
|
||||||
|
endif
|
||||||
|
|
||||||
# Architecture specific
|
# Architecture specific
|
||||||
# TODO: probably these flags need to be tweaked on some architectures
|
# TODO: probably these flags need to be tweaked on some architectures
|
||||||
@ -77,6 +81,23 @@ ifeq ($(UNAME_M),x86_64)
|
|||||||
ifneq (,$(findstring f16c,$(F16C_M)))
|
ifneq (,$(findstring f16c,$(F16C_M)))
|
||||||
CFLAGS += -mf16c
|
CFLAGS += -mf16c
|
||||||
endif
|
endif
|
||||||
|
else ifeq ($(UNAME_S),Haiku)
|
||||||
|
AVX1_M := $(shell sysinfo -cpu | grep "AVX ")
|
||||||
|
ifneq (,$(findstring avx,$(AVX1_M)))
|
||||||
|
CFLAGS += -mavx
|
||||||
|
endif
|
||||||
|
AVX2_M := $(shell sysinfo -cpu | grep "AVX2 ")
|
||||||
|
ifneq (,$(findstring avx2,$(AVX2_M)))
|
||||||
|
CFLAGS += -mavx2
|
||||||
|
endif
|
||||||
|
FMA_M := $(shell sysinfo -cpu | grep "FMA ")
|
||||||
|
ifneq (,$(findstring fma,$(FMA_M)))
|
||||||
|
CFLAGS += -mfma
|
||||||
|
endif
|
||||||
|
F16C_M := $(shell sysinfo -cpu | grep "F16C ")
|
||||||
|
ifneq (,$(findstring f16c,$(F16C_M)))
|
||||||
|
CFLAGS += -mf16c
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
CFLAGS += -mfma -mf16c -mavx -mavx2
|
CFLAGS += -mfma -mf16c -mavx -mavx2
|
||||||
endif
|
endif
|
||||||
|
4
ggml.c
4
ggml.c
@ -69,6 +69,10 @@ static int sched_yield (void) {
|
|||||||
typedef void* thread_ret_t;
|
typedef void* thread_ret_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
#define static_assert(cond, msg) _Static_assert(cond, msg)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define GGML_DEBUG 0
|
#define GGML_DEBUG 0
|
||||||
#define GGML_GELU_FP16
|
#define GGML_GELU_FP16
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user