Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ulysses
Beginner
33 Views

Eigenvalue and Eigenvector Example Problem Help

Jump to solution

Hi,

I've put together a quick program to figure out how to use the MKL library to calculate the eigenvalues and eigenvectors of a real symmetric matrix A. However, I get the following error message when compiling: "Error 1 error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MKL_LAPACK]". Can anyone help find my mistake? Any help would be appreciated. I have attached the sample project.

-Uly

Here is the code just in case the zip file doesn't upload:


program MKL_SpectralDecomp

use mkl_lapack

implicit none

integer n, ldz,lwork,liwork,lda,iwork,info
integer apsize

parameter (n=3)
parameter (lwork=n**2+6*n+1)
parameter (liwork=5*n+3)
parameter (ldz=n)
parameter (iwork=liwork)
parameter (lda=n)

character jobz,uplo
double precision ap(n*(n+1)/2),work(iwork)
double precision w(n),z(ldz,n)
data ap /3.0,4.0,6.0,5.0,7.0,8.0/
external dspevd

!!set parameters:
jobz='V'
uplo='U'



call dspevd(jobz, uplo, n, ap, w, z, ldz, work,
+ lwork, iwork, liwork, info)


pause
end

0 Kudos

Accepted Solutions
mecej4
Black Belt
33 Views
Since you use the Fortran-77 calling convention, you may obtain the interface to the MKL routine by inserting "include 'mkl.fi'" after the IMPLICIT NONE declaration. You have an incorrect declaration for the integer workspace IWORK(LIWORK). After you have added "include 'mkl.fi'", you need to remove the unneeded and inconsistent declaration of DSPEVD as EXTERNAL. Alternatively, use the much simpler Fortran 9X interface:
program MKL_SpectralDecomp use mkl95_lapack, only : SPEVD implicit none integer, parameter :: n=3 integer info double precision ap(n*(n+1)/2), w(n), z(n,n) data ap /3d0,4d0,6d0,5d0,7d0,8d0/ call spevd(ap, w, 'U', z, info) write(*,*)' Info from SPEVD: ',info write(*,*)w end

View solution in original post

3 Replies
mecej4
Black Belt
34 Views
Since you use the Fortran-77 calling convention, you may obtain the interface to the MKL routine by inserting "include 'mkl.fi'" after the IMPLICIT NONE declaration. You have an incorrect declaration for the integer workspace IWORK(LIWORK). After you have added "include 'mkl.fi'", you need to remove the unneeded and inconsistent declaration of DSPEVD as EXTERNAL. Alternatively, use the much simpler Fortran 9X interface:
program MKL_SpectralDecomp use mkl95_lapack, only : SPEVD implicit none integer, parameter :: n=3 integer info double precision ap(n*(n+1)/2), w(n), z(n,n) data ap /3d0,4d0,6d0,5d0,7d0,8d0/ call spevd(ap, w, 'U', z, info) write(*,*)' Info from SPEVD: ',info write(*,*)w end

View solution in original post

Ulysses
Beginner
33 Views
Thank you mecej4! Seems I put that example together too quickly. With your help I was able to find the problems in the code example. -Uly
Ulysses
Beginner
33 Views
Thank you mecej4! Seems I put that example together too quickly. With your help I was able to find the problems in the code example. -Uly