DrTimothyAldenDavis / SuiteSparse

The official SuiteSparse library: a suite of sparse matrix algorithms authored or co-authored by Tim Davis, Texas A&M University.
https://people.engr.tamu.edu/davis/suitesparse.html
Other
1.11k stars 256 forks source link

CI (MSVC): Install reference BLAS and LAPACK libraries. #824

Closed mmuetzel closed 1 month ago

mmuetzel commented 1 month ago

Be more careful not to mix binaries that have been built with different OpenMP implementations. Intel MKL is linked against libiomp5md. But these runners build with MSVC cl or LLVM clang-cl, respectively. I.e., they are linking against the MS implementation or the LLVM implementation of OpenMP, respectively. That is dangerous, since it can degrade performance or cause incorrect results.

Avoid that issue by linking against the reference implementations of the BLAS and LAPACK libraries that don't use OpenMP at all.

This should help to avoid issues like the one in #823 where the tests failed with this runtime error:

OMP: Error #15: Initializing libomp140.x86_64.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/