From: Georgi Gerganov Date: Thu, 23 Apr 2026 05:22:08 +0000 (+0300) Subject: ggml-base: use MATH_LIBRARY variable instead of hardcoded 'm' (#22239) X-Git-Tag: upstream/0.0.10438~1539 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=96c1db26c4441b10bb592aaac368842fc01e5617;p=pkg%2Fggml%2Fsources%2Fllama.cpp ggml-base: use MATH_LIBRARY variable instead of hardcoded 'm' (#22239) Fixes #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. --- diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index 48fbe208d..52754e1b9 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -473,7 +473,7 @@ target_link_libraries(ggml-base PRIVATE Threads::Threads) find_library(MATH_LIBRARY m) if (MATH_LIBRARY) if (NOT WIN32 OR NOT DEFINED ENV{ONEAPI_ROOT}) - target_link_libraries(ggml-base PRIVATE m) + target_link_libraries(ggml-base PRIVATE ${MATH_LIBRARY}) endif() endif()