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

Random number generation

Guanchen
Beginner
866 Views

Hi, I am a newbie to do high-performance-computing using C libraries. I am trying to revive codes inherented from our previous group memeber, at which time oneAPI was not a thing. The core of my problem seems to be how to use mkl to generate random numbers. 

 

I got error messages saying "LNK2019 unresolved external symbol vdRngGaussian referenced in function main". 

 

Any hint where shall I start to track down the problem? Or is there a simple example code I could use to call vdRngGaussian?

 

I have installed the latest mkl libaries on a windows machine. I am using the visual studio 2019. 

0 Kudos
1 Solution
Fengrui
Moderator
620 Views

You can enable oneMKL in Configuration Properties -> Intel Performance Libraries.

View solution in original post

0 Kudos
5 Replies
mecej4O
New Contributor I
825 Views

You have to instruct the compiler to link the MKL libraries to your objects. If you use the command line, use the /Qmkl option under Windows. If using VS, specify that the MKL libraries are to be used, by clicking the relevant setting in your project options.

0 Kudos
Guanchen
Beginner
707 Views

Hi, 

 

Thank you very much for the hint. This was how I configured the linker when I got this error. Anything wrong you could spot it out?

Guanchen_0-1763380370277.png

 

0 Kudos
mecej4O
New Contributor I
666 Views

You have specified where to find the MKL libraries, but did not specify which one(s) to use.

0 Kudos
Guanchen
Beginner
586 Views

Hi,

 

Thanks for pointing out the problem. I thought mkl_sequential.lib is one of the library(ies) that I have specified. But probably, not the one that gives me trouble. 

0 Kudos
Fengrui
Moderator
621 Views

You can enable oneMKL in Configuration Properties -> Intel Performance Libraries.

0 Kudos
Reply