Recently started using MKL alongside other wrapper libraries like Armadillo and ran into some LAPACK function definition conflicts. Upon closer inspection, it appears that the MKL definitions of ?gelsd functions are inconsistent in mkl_lapack.h, and are incorrect for sgelsd, dgelsd, zgelsd.
For sgelsd, dgelsd, and zgelsd, the parameter for matrix "a" is defined as "const type*". This should not be the case as matrix "a" is overwritten as an output so it should not be defined with a "const" qualifier in the function parameters.
cgelsd correctly defines "a" without the "const" qualifier. This should be an easy fix but I'm unsure as how to contribute to the MKL code base since it's not open source.
MKL Version: 2019.4
Thank you! It's not feasible for us to manually remove the const qualifiers since we automatically obtain the headers from Anaconda packages in our build system and there isn't an easy way to patch the files. Great to hear that it'll be fixed in the next version though.
Also, along the lines of function prototype definitions, it appears that MKL does not define the hidden arguments required for calling Fortran functions in its C prototypes. This is recently discovered to be wrong and can cause unintended stack corruptions during the calls. Is this something on your radar to be fixed?
Please see the linked threads for more information on this: