Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Error linking with Lapack

Pedersen__M
Beginner
725 Views

Hi

I am trying to run an example that solves a set of linear equations using SGESV, but during linking I get the following error messages:

 

1>mkl_intel_c.lib(_sgesv.obj) : error LNK2019: unresolved external symbol _mkl_serv_set_progress referenced in function _sgesv
1>mkl_intel_c.lib(_sgesv.obj) : error LNK2019: unresolved external symbol _mkl_serv_setxer referenced in function _sgesv
1>mkl_intel_c.lib(_sgesv.obj) : error LNK2019: unresolved external symbol _mkl_lapack_sgesv referenced in function _sgesv
1>mkl_intel_c.lib(_misc_mkl_progress_iface_u.obj) : error LNK2019: unresolved external symbol _mkl_serv_default_progress referenced in function _MKL_PROGRESS
1>mkl_intel_c.lib(_misc_mkl_xerbla_iface_u.obj) : error LNK2019: unresolved external symbol _mkl_serv_default_xerbla referenced in function _XERBLA

 

What am I doing wrong?

0 Kudos
6 Replies
TimP
Honored Contributor III
725 Views

Since you don't show us your link command or build log, I'll start by guessing you used something other than the /Qmkl option, but didn't follow the advice at http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor

0 Kudos
Pedersen__M
Beginner
725 Views

I am using Visual studio 2010.

Link command:

/OUT:"Debug\Ax_b_wrap.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\mkl\lib\intel64" /MANIFEST /MANIFESTFILE:"C:\mmpe\programming\Fortran\Ax_b_wrap\Ax_b_wrap\Debug\Ax_b_wrap.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\mmpe\programming\Fortran\Ax_b_wrap\Ax_b_wrap\Debug\Ax_b_wrap.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\mmpe\programming\Fortran\Ax_b_wrap\Ax_b_wrap\Debug\Ax_b_wrap.lib"  mkl_blas95_ilp64.lib mkl_lapack95_ilp64.lib mkl_intel_ilp64.lib mkl_core.lib mkl_intel_thread.lib

build log:

 
Linking...
Link /OUT:"Debug\Ax_b_wrap.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\mkl\lib\intel64" /MANIFEST /MANIFESTFILE:"C:\mmpe\programming\Fortran\Ax_b_wrap\Ax_b_wrap\Debug\Ax_b_wrap.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\mmpe\programming\Fortran\Ax_b_wrap\Ax_b_wrap\Debug\Ax_b_wrap.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\mmpe\programming\Fortran\Ax_b_wrap\Ax_b_wrap\Debug\Ax_b_wrap.lib"  mkl_blas95_ilp64.lib mkl_lapack95_ilp64.lib mkl_intel_ilp64.lib mkl_core.lib mkl_intel_thread.lib "Debug\test.obj"
Link: executing 'link'
mkl_intel_c.lib(_sgesv.obj) : error LNK2019: unresolved external symbol _mkl_serv_set_progress referenced in function _sgesv
mkl_intel_c.lib(_sgesv.obj) : error LNK2019: unresolved external symbol _mkl_serv_setxer referenced in function _sgesv
mkl_intel_c.lib(_sgesv.obj) : error LNK2019: unresolved external symbol _mkl_lapack_sgesv referenced in function _sgesv
mkl_intel_c.lib(_misc_mkl_progress_iface_u.obj) : error LNK2019: unresolved external symbol _mkl_serv_default_progress referenced in function _MKL_PROGRESS
mkl_intel_c.lib(_misc_mkl_xerbla_iface_u.obj) : error LNK2019: unresolved external symbol _mkl_serv_default_xerbla referenced in function _XERBLA
Debug\Ax_b_wrap.exe : fatal error LNK1120: 5 unresolved externals


Ax_b_wrap - 6 error(s), 0 warning(s)

 

0 Kudos
TimP
Honored Contributor III
725 Views

The link command appears to match the recommendation.  Does your setup for the USE F95_LAPACK match the compile instructions with  /module specified?

/integer-size:64 /Qopenmp /module:%MKLROOT%/include/intel64/ilp64 -I%MKLROOT%/include

I don't find any reference to mkl_serv_setxer in the mkl\lib\intel64 so I can't exclude references coming from a different variety of MKL.

MKLROOT appeared to be expanded correctly in your link step. integer-size or the like would be needed if you have default kind integers in your MKL calls, but I don't expect that to be implicated in your error report.

I assume your .obj was built with /X64 set in the project.

In my installation it appears that MKL lapack95 was set up at installation.  In past versions you were required to build it yourself using the supplied sources, but that doesn't appear to be implicated in your problem.

The problem seems deep enough into MKL that the MKL forum might find a more expert response.

0 Kudos
Ying_H_Intel
Employee
725 Views

Hi Mads P.

Are you build Intel Fortran project with Lapack 95 interface?  could you provide a test case to us?

One similiar problem for your reference http://software.intel.com/en-us/forums/topic/506711

Best Regards,
Ying

0 Kudos
Gennady_F_Intel
Moderator
725 Views
/IMPLIB:"C:\mmpe\programming\Fortran\Ax_b_wrap\Ax_b_wrap\Debug\Ax_b_wrap.lib"  mkl_blas95_ilp64.lib mkl_lapack95_ilp64.lib mkl_intel_ilp64.lib mkl_core.lib mkl_intel_thread.lib

you use 32 bit (mkl_intel_thread.lib) while linking with 64 bits libraries. pls remove this lib from the linking line.
I think this is the cause of this problem: "mkl_intel_c.lib(_sgesv.obj) : error LNK2019: unresolved external symbol _mkl_serv_set_progress referenced in function _sgesv"
and also - pls check again the MKL linker Adsviser which Tim have already recommended you.

--Gennady

0 Kudos
Pedersen__M
Beginner
725 Views

Thank you all for your help.

I was compiling for win32 while linking to x64 libraries - stupid me, and thank you again

--Mads

0 Kudos
Reply