- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I'm trying to use mkl_vsl module to generate random num, what I did as follows:
First : I found a file name mkl_vsl.fi ,then I copy it to the %IA32% directory, 'ifort /c mkl_vsl.fi' then I got two mod file : mkl_vsl & mkl_vsl_type
second , follow is my program:
use mkl_vsl
use mkl_vsl_type
integer status !Error / status
integer brng !Index of generator to initialize stream
integer method !Method = 0 in case of uniform distribution
integer dimen !Initial condition of the stream
TYPE (VSL_STREAM_STATE) :: stream !Random stream
integer, PARAMETER :: nr = 1000 !Number of values required (whatever you want)
real gauss(nr)
real mean, sigma
mean = 0.0
sigma = 1.0
!SOBEL
method = VSL_METHOD_SGAUSSIAN_ICDF !NB - are different alternatives, but I found this worked well
brng = VSL_BRNG_SOBOL
dimen = 1 ! <== different values may be needed depending on application
gauss = 0.0
status = vslnewstream( stream, brng, dimen ) !Create new stream (SOBOL in this case
status = vsrnggaussian( method, stream, nr, gauss, mean, sigma )
status = vsldeletestream( stream ) !Delete the stream
!For alternate random types, substitute
! brng = VSL_BRNG_MT19937
! brng = VSL_BRNG_MRG32K3A
!NB: I found VSL_BRNG_MT19937 overall best for my applicat
end
But when I compile it ,the compiler showed 'error linker _vslnewstream; _vsrnggaussian; _vsldeletestream',but I could found these three functions in mkl_vsl.fi,why this happened?
Thanks for any answer!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I'm trying to use mkl_vsl module to generate random num, what I did as follows:
First : I found a file name mkl_vsl.fi ,then I copy it to the %IA32% directory, 'ifort /c mkl_vsl.fi' then I got two mod file : mkl_vsl & mkl_vsl_type
second , follow is my program:
use mkl_vsl
use mkl_vsl_type
integer status !Error / status
integer brng !Index of generator to initialize stream
integer method !Method = 0 in case of uniform distribution
integer dimen !Initial condition of the stream
TYPE (VSL_STREAM_STATE) :: stream !Random stream
integer, PARAMETER :: nr = 1000 !Number of values required (whatever you want)
real gauss(nr)
real mean, sigma
mean = 0.0
sigma = 1.0
!SOBEL
method = VSL_METHOD_SGAUSSIAN_ICDF !NB - are different alternatives, but I found this worked well
brng = VSL_BRNG_SOBOL
dimen = 1 ! <== different values may be needed depending on application
gauss = 0.0
status = vslnewstream( stream, brng, dimen ) !Create new stream (SOBOL in this case
status = vsrnggaussian( method, stream, nr, gauss, mean, sigma )
status = vsldeletestream( stream ) !Delete the stream
!For alternate random types, substitute
! brng = VSL_BRNG_MT19937
! brng = VSL_BRNG_MRG32K3A
!NB: I found VSL_BRNG_MT19937 overall best for my applicat
end
But when I compile it ,the compiler showed 'error linker _vslnewstream; _vsrnggaussian; _vsldeletestream',but I could found these three functions in mkl_vsl.fi,why this happened?
Thanks for any answer!
Hi,
are you building it in VS? mkl_vsl.fi must be "visible" for compiler, and you provide that information via "Include directories" setting.
In your case linker complains that it cannot see _vslnewstream; _vsrnggaussian; _vsldeletestream functions you used. Please set the *.lib files in your linker line(s).
If you provide a bit more info on your environment and settings, then better (more accurate) help can be provided.
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
are you building it in VS? mkl_vsl.fi must be "visible" for compiler, and you provide that information via "Include directories" setting.
In your case linker complains that it cannot see _vslnewstream; _vsrnggaussian; _vsldeletestream functions you used. Please set the *.lib files in your linker line(s).
If you provide a bit more info on your environment and settings, then better (more accurate) help can be provided.
A.
Thanks for your timely reply! Ihave changed my program by add a definition:
!DEC$ OBJCOMMENT LIB:'mkl_lapack95.lib'
!DEC$ OBJCOMMENT LIB:'mkl_blas95.lib'
!DEC$ OBJCOMMENT LIB:'mkl_solver.lib'
!DEC$ OBJCOMMENT LIB:'mkl_sequential.lib'
!DEC$ OBJCOMMENT LIB:'mkl_intel_c.lib'
!DEC$ OBJCOMMENT LIB:'mkl_core.lib'
!DEC$ OBJCOMMENT LIB:'mkl_solver_sequential.lib'
and it worked well ,but i have another question : from the netadress http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ , I can't find which static lib this module depend on , so what can I do ?
right way , my workplatform is : windows 7 RC 64 bit+ vs2008+ ifort 11.1.051 IA32/64
Thanks for your answer!
have a nice day!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your timely reply! Ihave changed my program by add a definition:
!DEC$ OBJCOMMENT LIB:'mkl_lapack95.lib'
!DEC$ OBJCOMMENT LIB:'mkl_blas95.lib'
!DEC$ OBJCOMMENT LIB:'mkl_solver.lib'
!DEC$ OBJCOMMENT LIB:'mkl_sequential.lib'
!DEC$ OBJCOMMENT LIB:'mkl_intel_c.lib'
!DEC$ OBJCOMMENT LIB:'mkl_core.lib'
!DEC$ OBJCOMMENT LIB:'mkl_solver_sequential.lib'
and it worked well ,but i have another question : from the netadress http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ , I can't find which static lib this module depend on , so what can I do ?
right way , my workplatform is : windows 7 RC 64 bit+ vs2008+ ifort 11.1.051 IA32/64
Thanks for your answer!
have a nice day!
I'm not sure you need all that libraries (solver for instance) for random numbers. Please note that you picked sequential versions (intentionally?).
If you want to check librarier or your code dependcies use DependencyWalker.
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your wonderful suggestions! ,I have download this smart software,it works well on my compute!~
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page