Skip to content

Fix MSVC math library link#33

Open
rodrigomatta wants to merge 1 commit into
mainfrom
staging
Open

Fix MSVC math library link#33
rodrigomatta wants to merge 1 commit into
mainfrom
staging

Conversation

@rodrigomatta
Copy link
Copy Markdown
Owner

@rodrigomatta rodrigomatta commented May 17, 2026

Summary

Fixes the MSVC Windows CMake issue where ggml-base could receive MATH_LIBRARY-NOTFOUND.lib as a linker dependency.

On MSVC, math functions are provided by the Visual Studio CRT, so there is no separate libm/m library to link. The top-level CMake now sets MATH_LIBRARY to an empty
cache value for MSVC before loading ggml, preventing MATH_LIBRARY-NOTFOUND from propagating into generated Visual Studio projects.

This PR also brings staging up to date with main.

Verification

  • Configured and built CPU Release successfully:
    • cmake -S . -B build-cpu -DCMAKE_BUILD_TYPE=Release -DS2_AUTO_APPLY_LOCAL_PATCHES=ON -DS2_VULKAN=OFF
    • cmake --build build-cpu --config Release
  • Configured and built Vulkan Release successfully:
    • cmake -S . -B build-vulkan -DCMAKE_BUILD_TYPE=Release -DS2_AUTO_APPLY_LOCAL_PATCHES=ON -DS2_VULKAN=ON
    • cmake --build build-vulkan --config Release
  • Verified both binaries with s2 --help
  • Confirmed no generated MATH_LIBRARY-NOTFOUND / NOTFOUND.lib entries in build-cpu or build-vulkan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant