- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I have a strange problem. I wrote two programs where I use MKL libraries.
I compile them with the following command:
ifort -r8 *.f90 -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -mkl=sequential
and this is my bash file:
source /opt/intel/bin/compilervars.sh intel64 source /opt/intel/mkl/bin/mklvars.sh intel64 mod lp64 export PATH
I use the following MKL subroutines in both program:
USE lapack95 IMPLICIT NONE ... ... .. .. CALL GETRF(A,B,info)
The compilation of the first program works fine. However, when i compile the second one i get:
There is no matching specific subroutine for this generic subroutine call. [GETRF] CALL GETRF(A,B,info)
In the second program all the subroutines and functions are inside a module while in the first one only the functions have a module.
what I get it wrong?
Thanks a lot
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is not possible to answer questions about argument mismatches when you do not show the declarations of the MKL subroutine arguments in question. In particular, what is the declaration of the second argument, B, in the two programs? Or, perhaps better still, can you post the two programs, if they are not too long?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When a subroutine is inside a module, and you "USE" the module, the compiler can see the interface and emit an error at compile time if there is an argument mismatch between caller and callee. If the subroutine is not in a module, the compiler can't see the interface (unless you code one explicitly), and so can't detect any argument mismatches. These are likely to show up as link-time or run-time errors instead, and may be much harder to debug. In the long term, it's better to get descriptive error messages at compile time.
In the case where you don't use modules, it's good practice to compile with -gen-interfaces and -warn interfaces, so that you can still get messages about argument mismatches at compile time. This doesn't save you from carefully checking argument types against the documentation and/or header files.
For GETRF, is your second argument "B" declared as an integer array?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I am sorry, Martyn you are right. I have forgotten to decleare B as integer.
Here the sample program, correct this time.
Thanks again
program testmkl use LAPACK95 implicit none real ,allocatable,dimension(:,:)::AA integer ,allocatable,dimension(:)::BB integer :: info,n n=10 allocate(AA(n,n)) allocate(BB(n)) call GETRF(AA,BB,info) endprogram

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