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

mkl_c.lib - 64bit equivalent

davidspurr
Beginner
1,930 Views

(w_cprof_p_11.0.061, MKL 10.1.0.018)

I have a program with one subroutine that uses a couple of RNG functions from MKL. The program compiles 'OK' as a 32bit application (only 'OK' because I do get a warning message about mkl_c.lib, but the RNG's were working when I last used that part of the program about 20 months ago.)


However, when I now attempt to compile it as a 64bit app, I get a fatal link error.

error LNK2019: unresolved external symbol VSLNEWSTREAM referenced in function PARAMETRIC

error LNK2019: unresolved external symbol VSRNGGAUSSIAN referenced in function PARAMETRIC

For the 32bit app I have mkl_c.lib & libguide.lib as additional dependencies (Configuration Properties / Linker / Input).

When I encountered problems compiling as a 64bit app, I found I had no additional dependencies for 64bit compiler, so I copied in mkl_c.lib & libguide.lib, but then I get the following error:

fatal error LNK1181: cannot open input file 'mkl_c.lib' LINK

I then discovered that there is no mkl_c.lib for 64bit; ie no such file in

C:\\Program Files\\Intel\\MKL\\10.1.0.018\\ia64\\lib

or anywhere else I looked in the 64bit folders.

Can anyone please advise what lib's I need to specify to get the RNG functions from MKL to work in a 64bit app?

I tried mkl_intel_c.lib and mkl_core.lib but still get fatal error LNK1181.

0 Kudos
5 Replies
ArturGuzik
Valued Contributor I
1,930 Views

David,

as in my reply to your previous post, and according to the release notes and KB, the replacement for the stub mkl_c.lib are (for x64): mkl_intel_thread.lib mkl_core.lib. So you need both of them and your integers model (lp or ilp). Also using libiomp5md.lib instead of old libguide is usually recommended.

you can take a look at this KB article.

But you error message suggests your linker still wants mkl_c.lib, so maybe you refer to it somewhere.

A.

0 Kudos
davidspurr
Beginner
1,930 Views

Thanks

After more experimenting & now using mkl_intel_thread.lib mkl_core.lib & libiomp5md.li, I no longer get the "fatal error LNK1181" message, which I guess means it is finding those lib files OK.

However, I am now back to my original messages:

error LNK2019: unresolved external symbol VSLNEWSTREAM referenced in function PARAMETRIC

error LNK2019: unresolved external symbol VSRNGGAUSSIAN referenced in function PARAMETRIC

I have done something a little 'non-standard' in that I have the contents of modules "MKL_VSL_TYPE" and "MKL_VSL" directly in my code, rather than as external (I did this to make the code more portable - exe distributed to "non-tech" people so wanted to distribute only a single exe file, with no dependent dll files etc).

The functions "VSLNEWSTREAM" and "VSRNGGAUSSIAN" are definitely are included in "MKL_VSL". I put the two modules in a file called "mkl_vsl.f90". When I do a full rebuild, that file ("mkl_vsl.f90") is the first one to be compiled, so I do not understand why the linker cannot find them.

I do not get the error messages when I compile it as a 32bit app & as mentioned previously, this part of the program was working fine 20 months ago (as a 32bit app).

From what I can deduce from Table 5.3 of the user guide, all I should need for the VSL functions is mkl_core.lib?

Not certain where to go from here :(

0 Kudos
TimP
Honored Contributor III
1,930 Views
Quoting davidspurr
, all I should need for the VSL functions is mkl_core.lib?

Not certain where to go from here :(

Perhaps you might consult the link advisor on the head page of this forum?

If you're moving to 64-bit, mkl_core has to be accompanied by the lp64 (if you didn't change source data types from the 32-bit case) or ilp64 library, and either mkl_sequential or mkl_thread plus OpenMP library.

0 Kudos
davidspurr
Beginner
1,930 Views

Hmm - just finshed a 4 paragraph note & hit "Submit" only to get an fatal error & lose the lot :(

Just read Tim's post (thanks) - will follow up on that.

0 Kudos
davidspurr
Beginner
1,930 Views

Tim, many thanks. the "mkl_intel_lp64.lib" was indeed the missing link !!

But what an exercise, just to change from 32 - 64 bit compile :( ...

Also, thanks for the tip re the link advisor (had not noticed that). Very straightforward - right answer and all !!!

0 Kudos
Reply