- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am having trouble compiling this very simple program:
include 'mkl_vsl.fi'
program UsingMKL
implicit none
integer i
TYPE (VSL_STREAM_STATE) :: stream
integer(kind=4) errcode
integer brng, method, method1, method2, seed
real rvec(1000)
brng = VSL_BRNG_MT19937
method = VSL_METHOD_DGAUSSIAN_BOXMULLER
seed = 112233445
! ***** Initializing *****
errcode = vslnewstream(stream, brng,seed)
status = vdrnggaussian(method, stream,1000, &
rvec, real(0.0,dp), real(1.0,dp))
open(unit = 1, file = "NormalNumbers.csv")
do i = 1, 1000
write(1,*) rvec(i)
end do
close(1)
end program UsingMKL
This is the command I am typing at the command line:
ifort ~/UsingMKL.f90 -L$MKLPATH -I$MKLINCLUDE -Wl,--start-group $MKLPATH/libmkl_intel_lp64.a $MKLPATH/libmkl_intel_thread.a $MKLPATH/libmkl_core.a -Wl,--end-group -liomp5 -lpthread
Where the environment variables MKLPATH and MKLINCLUDE are well defined. I am working on an Intel 64 compatible architecture, so that's the command I found in the MKL user guide.
I am not able to compile this simple code. I am getting the following error messages:
/home/rdc/UsingMKL.f90(9): error #6457: This derived type name has not been declared. [VSL_STREAM_STATE]
TYPE (VSL_STREAM_STATE) :: stream
------^
/home/rdc/UsingMKL.f90(14): error #6404: This name does not have a type, and must have an explicit type. [VSL_BRNG_MT19937]
brng = VSL_BRNG_MT19937
-------^
/home/rdc/UsingMKL.f90(15): error #6404: This name does not have a type, and must have an explicit type. [VSL_METHOD_DGAUSSIAN_BOXMULLER]
method = VSL_METHOD_DGAUSSIAN_BOXMULLER
---------^
/home/rdc/UsingMKL.f90(19): error #6404: This name does not have a type, and must have an explicit type. [VSLNEWSTREAM]
errcode = vslnewstream(stream, brng,seed)
----------^
/home/rdc/UsingMKL.f90(21): error #6404: This name does not have a type, and must have an explicit type. [STATUS]
status = vdrnggaussian(method, stream,1000, &
^
/home/rdc/UsingMKL.f90(21): error #6404: This name does not have a type, and must have an explicit type. [VDRNGGAUSSIAN]
status = vdrnggaussian(method, stream,1000, &
---------^
compilation aborted for /home/rdc/UsingMKL.f90 (code 1)
I appreciate any help.
Many thanks,
Rafael
I am having trouble compiling this very simple program:
include 'mkl_vsl.fi'
program UsingMKL
implicit none
integer i
TYPE (VSL_STREAM_STATE) :: stream
integer(kind=4) errcode
integer brng, method, method1, method2, seed
real rvec(1000)
brng = VSL_BRNG_MT19937
method = VSL_METHOD_DGAUSSIAN_BOXMULLER
seed = 112233445
! ***** Initializing *****
errcode = vslnewstream(stream, brng,seed)
status = vdrnggaussian(method, stream,1000, &
rvec, real(0.0,dp), real(1.0,dp))
open(unit = 1, file = "NormalNumbers.csv")
do i = 1, 1000
write(1,*) rvec(i)
end do
close(1)
end program UsingMKL
This is the command I am typing at the command line:
ifort ~/UsingMKL.f90 -L$MKLPATH -I$MKLINCLUDE -Wl,--start-group $MKLPATH/libmkl_intel_lp64.a $MKLPATH/libmkl_intel_thread.a $MKLPATH/libmkl_core.a -Wl,--end-group -liomp5 -lpthread
Where the environment variables MKLPATH and MKLINCLUDE are well defined. I am working on an Intel 64 compatible architecture, so that's the command I found in the MKL user guide.
I am not able to compile this simple code. I am getting the following error messages:
/home/rdc/UsingMKL.f90(9): error #6457: This derived type name has not been declared. [VSL_STREAM_STATE]
TYPE (VSL_STREAM_STATE) :: stream
------^
/home/rdc/UsingMKL.f90(14): error #6404: This name does not have a type, and must have an explicit type. [VSL_BRNG_MT19937]
brng = VSL_BRNG_MT19937
-------^
/home/rdc/UsingMKL.f90(15): error #6404: This name does not have a type, and must have an explicit type. [VSL_METHOD_DGAUSSIAN_BOXMULLER]
method = VSL_METHOD_DGAUSSIAN_BOXMULLER
---------^
/home/rdc/UsingMKL.f90(19): error #6404: This name does not have a type, and must have an explicit type. [VSLNEWSTREAM]
errcode = vslnewstream(stream, brng,seed)
----------^
/home/rdc/UsingMKL.f90(21): error #6404: This name does not have a type, and must have an explicit type. [STATUS]
status = vdrnggaussian(method, stream,1000, &
^
/home/rdc/UsingMKL.f90(21): error #6404: This name does not have a type, and must have an explicit type. [VDRNGGAUSSIAN]
status = vdrnggaussian(method, stream,1000, &
---------^
compilation aborted for /home/rdc/UsingMKL.f90 (code 1)
I appreciate any help.
Many thanks,
Rafael
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nevermind, I already solved my problem...
I forgot to add
USE MKL_VSL_TYPE
USE MKL_VSL
and some other things...
I apologize.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page