Skip to content

Commit a55c1e9

Browse files
committed
link to libdl on linux
1 parent ccd8df8 commit a55c1e9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ endif
290290
# some memory allocation are available on Linux through GNU extensions in libc
291291
ifeq ($(UNAME_S),Linux)
292292
MK_CPPFLAGS += -D_GNU_SOURCE
293+
MK_LDFLAGS += -ldl
293294
endif
294295

295296
# RLIMIT_MEMLOCK came in BSD, is not specified in POSIX.1,

ggml/src/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ add_library(ggml
230230

231231
target_link_libraries(ggml PUBLIC ggml-base)
232232

233+
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
234+
target_link_libraries(ggml PRIVATE dl)
235+
endif()
236+
233237
function(ggml_add_backend backend)
234238
string(TOUPPER "GGML_${backend}" backend_id)
235239
if (${backend_id})

0 commit comments

Comments
 (0)