From 0b2f60174778ea56387cf002f9b546f12ddfe08d Mon Sep 17 00:00:00 2001 From: divinity76 Date: Fri, 22 Dec 2023 13:08:20 +0100 Subject: [PATCH] Allow compiling on Cygwin g++ This patch allows compiling on Cygwin. Cygwin has partial support for RLIMIT, for example RLIMIT_STACK is supported, but RLIMIT_MEMLOCK is not :( (see https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/resource.cc;hb=HEAD for details) --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index 4e4495739..888d0ea9c 100644 --- a/llama.cpp +++ b/llama.cpp @@ -1044,7 +1044,7 @@ struct llama_mlock { } } -#ifdef _POSIX_MEMLOCK_RANGE +#if defined(_POSIX_MEMLOCK_RANGE) && defined(RLIMIT_MEMLOCK) static constexpr bool SUPPORTED = true; static size_t lock_granularity() {