Skip to content

Commit fe6a988

Browse files
Manually link -lbsd to resolve flock symbol on AIX (#16610)
1 parent 061f0ef commit fe6a988

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tools/imatrix/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ target_compile_features(${TARGET} PRIVATE cxx_std_17)
66
if(LLAMA_TOOLS_INSTALL)
77
install(TARGETS ${TARGET} RUNTIME)
88
endif()
9+
10+
if (CMAKE_SYSTEM_NAME MATCHES "AIX")
11+
# AIX's flock() function comes from libbsd.a
12+
target_link_libraries(${TARGET} PRIVATE -lbsd)
13+
endif()

tools/run/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@ endif ()
1313
if(LLAMA_TOOLS_INSTALL)
1414
install(TARGETS ${TARGET} RUNTIME)
1515
endif()
16+
17+
if (CMAKE_SYSTEM_NAME MATCHES "AIX")
18+
# AIX's flock() function comes from libbsd.a
19+
target_link_libraries(${TARGET} PRIVATE -lbsd)
20+
endif()
21+
1622
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT} ${LLAMA_RUN_EXTRA_LIBS})
1723
target_compile_features(${TARGET} PRIVATE cxx_std_17)

0 commit comments

Comments
 (0)