- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to use the MKL library function GEMM in my code by adding the line INCLUDE "mkl.fi" and compliling with option /Qmkl in commandline. I am getting the error LNK2019: unresolved external symbol _GEMM. Am I missing anything? However, I tried to use VSCBRT function with appropriate include file, and it works. Please help.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to follow the prescribed way of telling the compiler and linker that your code uses BLAS95 routines such as DGEMM. See the example driver dgemx.f90 in the .../mkl/examples/blas95/source directory.
To call DGEMM using the F9x interface, you need "USE mkl95_blas" before the declarations section of your program, and link to mkl_blas95.lib.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For lapack95 support, you need
use lapack95
to accomplish the substitutions of specific MKL functions for generic ones such as gemm. I suppose this might conflict with mkl.fi, but the latter would not handle the lapack95 calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried to replace "mkl.fi" with "blas.f90", but it throws many errors since blas.f90 is the collection of interfaces alone. I use the command line of IA-32, Version 12.1.5.344 [Visual Studio 2005].
?gemm page of MKL user manual says:
Include Files:
Fortran : mkl.fi
Fortran 95 : blas.f90
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to follow the prescribed way of telling the compiler and linker that your code uses BLAS95 routines such as DGEMM. See the example driver dgemx.f90 in the .../mkl/examples/blas95/source directory.
To call DGEMM using the F9x interface, you need "USE mkl95_blas" before the declarations section of your program, and link to mkl_blas95.lib.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks mecej4. I tried it and found working with sgemm, not GEMM alone as indicated in manual. However, while running, I get error:
forrtl: severe (157): Program Exception - access violation.
Not sure what I miss.
test.f90************
PROGRAM test
use mkl95_blas
real*4 :: a(10,10),b(10,10),c(10,10)
a=1.0
b=1.0
call sgemm(a,b,c)
END PROGRAM test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The access violation was a result of your "fixing" something that was not broken. You called the F77 SGEMM routine with an incorrect argument list.
Try this:
[fortran]PROGRAM test
use mkl95_blas
real*4 :: a(5,3),b(3,4),c(5,4)
a=1.0
b=2.0
call gemm(a,b,c)
write(*,10)(c(i,:),i=1,5)
10 format(1x,4ES12.4)
END PROGRAM test
[/fortran]
[bash]ifort /MD /Qmkl gemx.f90 mkl_blas95.lib[/bash]

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