FindBLAS finds static libiomp5 if BLA_STATIC, which is not recommended
In the case of MKL, FindBLAS finds libiomp5
stored as BLAS_iomp5_LIBRARY
,
which is static if BLA_STATIC
.
However, static linkage against Intel OpenMP is not recommended: https://community.intel.com/t5/Intel-Fortran-Compiler/Qopenmp-link-static-is-deprecated/m-p/797139
The use of static OpenMP libraries is not recommended, because they might cause multiple libraries to be linked in an application. The condition is not supported and could lead to unpredictable results.
This hits our code—it does not reproduce results if
-
libiomp5.a
is linked multiple times, or - both of
libiomp5.a
(BLAS_iomp5_LIBRARY
) andlibiomp5.so
(OpenMP_iomp5_LIBRARY
) are linked.