Skip to content

Commit 96c1db2

Browse files
authored
ggml-base: use MATH_LIBRARY variable instead of hardcoded 'm' (ggml-org#22239)
Fixes ggml-org#22237 — the find_library(MATH_LIBRARY m) result was being discarded and the target linked against the literal 'm' string. This prevents users from overriding the math library (e.g. for AMD AOCL) via CMake variables. Now the discovered MATH_LIBRARY is used directly.
1 parent 4ead6fd commit 96c1db2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ggml/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ target_link_libraries(ggml-base PRIVATE Threads::Threads)
473473
find_library(MATH_LIBRARY m)
474474
if (MATH_LIBRARY)
475475
if (NOT WIN32 OR NOT DEFINED ENV{ONEAPI_ROOT})
476-
target_link_libraries(ggml-base PRIVATE m)
476+
target_link_libraries(ggml-base PRIVATE ${MATH_LIBRARY})
477477
endif()
478478
endif()
479479

0 commit comments

Comments
 (0)