- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to use the fortran blas 95 interfaces. I haven't used BLAS or intel mkl before. I tried a little test program:
program testand then tried compiling it like so:
integer, parameter :: N=10
real :: x(N),y(N)
integer :: i
do i=1,10
x(i)=2e0
y(i)=1e0
enddo
res=sdot(x,y)
print*,'SDOT=',res
end program test
ifort test.f90 -o test -L$MKLPATH -lmkl_blas95 -lmkl_lapack -lmkl_ia32 -lguide -lpthread
and then I get the message that it can't find -lmkl_blas95. I then copied over the libmkl_blas95.a file that was created when I built the interface according the the manual to the /mkl/8.1/lib/32/ directory where all the other library files are held. Compiling now works, but when I run the program I get the error
"forrtl: severe (174): SIGSEGV, segmentation fault occurred
Stack trace terminated abnormally."
I don't really understand how to link everything properly, and so any help would be greatly appreciated!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort test.f90 -o test -L$MKLPATH -lmkl_ia32 -lguide -lpthread
since the libguide has two versions?
Also, I notice that libmkl_blas95.a doesn't have a .so counterpart. Does this mean that it cannot be dynamically linked?
I'm sorry if these are stupid questions--I really am not experienced in these matters. Thank you for any help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You must include the blas95 interfaces in your source. Without interfaces, you are calling the f77 interface with no checking, so you are calling the f77 sdot with no length argument. The blas95 interfaces fix it up by using size intrinsic to pass the length, and they make your invocation of the dot function refer to the appropriate f77 function, according to the data type of your arguments.
sdot would still be a direct call to the old style interface, and would not be checked unless you included the corresponding USE file.
In the examples directory, there is an example ddotx.f90of double precision usage. You might try that, then make a single precision version of it. Note the USE lines, setting working precision to double (in the example case) and invoking the mklblas_95 interfaces.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the mkl95_blas module and then compile with ...
-I/opt/intel/mkl/include -L/opt/intel/mkl/lib/32/ -lmkl_blas95 -lmkl
program test
use mkl95_blas
.
.
.
end program test
Make sure that the include path contains the needed modules (mkl95_blas.mod, mkl95_precision.mod etc.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One more question: when I built the mkl interface, does it make a difference if I compile with optimizations (like the -fast switch). It shoudln't right?
Once again, thank you very much for helping,
sincerely,
Alexis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page