]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ggml-base: use MATH_LIBRARY variable instead of hardcoded 'm' (#22239)
authorGeorgi Gerganov <redacted>
Thu, 23 Apr 2026 05:22:08 +0000 (08:22 +0300)
committerGitHub <redacted>
Thu, 23 Apr 2026 05:22:08 +0000 (08:22 +0300)
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.

ggml/src/CMakeLists.txt

index 48fbe208d900ecbba47e1bfd2e225c1aedfb1344..52754e1b9d6e5d27b0465ba0cb4b503489cfbe4b 100644 (file)
@@ -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()