Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
6698 Discussions

mixed C++ fortran progamming using mkl

Hello guys, I use VisualStudio.NET 2002 as the programming IDE with the last release of Intel C++ and Fortran compilers. I'm dealing with numerical programming so that my solutions are a mix of fortran and C++ projects all intensively using blas and lapack packages from Intel (MKL 6.0 beta). And now the problem. The C++ project, a static library, say cmod.lib, use the cdecl version of the mkl_c_dll.lib library while the fortran modules say fmod.lib, require mkl_s_dll.lib (is this true?). When i'm going to link the 2 modules with a project that requires both, should i add mkl_c_dll or mkl_s_dll? If I link it with che mkl_c_dll i get runtime errors called by the fortran module and, on the opposite, if i link with mkl_s_dll i get runtime errors from the c module. Can anyone help me?
0 Kudos
1 Reply
Dear Customer, I talked this issue with MKL engineering team, here is the response: The user needs to control the interfaces from his program. He cannot mix and match into the library. Mkl_s has both decorated and undecorated names in it. So, for instance, in the case of dgemm, there is both _DGEMM and _DGEMM@60. In mkl_c.lib there is also DGEMM. But the first is CVF default (nearly stdcall) and the second is cdecl. First of all there would be multiple defines. Second, you can't call cdecl from stdcall or the other way around. The default interface with the Intel compiler is cdecl, so he can call the functions from Intel C, Intel Fortran and MSVC in mkl_c. Then he would use mkl_c_dll.lib. If you have any further questions regarding this issue, please contact us for MKL support via Intel Premier Support at Thanks, Ying S Intel Customer Support For MKL on-line help, please visit <> For general support information: <>