cmake: refined conditions for math library linking on windows - #11312
cmake: refined conditions for math library linking on windows#11312Xarbirus wants to merge 1 commit into
Conversation
Can you suggest a way to reproduce the issue that you are seeing? Does it happen with a specific version of mingw? I have mingw installed alongside MSVC, and the github runners do as well, so at least it doesn't happen in every case. |
|
Hi @slaren in my case, the problem occurs when 3 compilers are installed on the system at once: msvc, mingw and clang. In my understanding the problem occurs because cmake finds libraries related to mingw (m.lib) because the path to mingw is in the path environment variable. |
|
Hi @slaren! I would like to clarify if there are any plans to merge this pr? |
|
I was not able to reproduce the issue that you mentioned. I have all 3 compilers installed, and so does the github CI. I am not comfortable merging something that I don't understand. |
|
Okay, thanks, I'll try to dig deeper into our CI. |
I encountered some problems when building llama.cpp on windows (for x64 and arm64) on a system where MSVC (with clang) and mingw are installed at the same time.
It seems to me that the condition for adding MATH_LIBRARY to the build is not quite correct. MATH_LIBRARY should not be added if
An important addition - in case clang is used in the MSVC pipeline, we should not add the library (condition
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"was added for this). At the same time, when building with mingw, the library can be added.I think this would also be a solution to this issue (if it hadn't closed).