error in compiling in intel fortran

error in compiling in intel fortran

I am new to intel fortran.I am using math kernel library in my program.I am using getrf,getrs function in my program.

before compiling ,I set the environment variables using the following commands in terminal

source /opt/intel/bin/ ia32

source /opt/intel/mkl/bin/mklvars/sh ia32

for compiling i used the following command

ifort beta4.f90 -mkl

i am getting the following error message

 error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [LAPACK95]
use lapack95
compilation aborted for beta4.f90 (code 1)

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

try adding this to your ifort command line

-I $MKLROOT/include/ia32

now i am getting another error.

dhananjay@ubuntu:~/Desktop/fortran_practice$ ifort beta4.f90 -I $MKLROOT/include/ia32
beta4.f90(302): error #6285: There is no matching specific subroutine for this generic subroutine call.   [GETRF]
call getrf(Kglobal,ipiv)
beta4.f90(303): error #6285: There is no matching specific subroutine for this generic subroutine call.   [GETRS]
call getrs(Kglobal,ipiv,force)
compilation aborted for beta4.f90 (code 1)

When the error message contains "There is no matching specific subroutine..", the implication is that the compiler knows the proper interface (because you have a USE that covers the subroutine in question, in this case), and you have to check the types, number and sequence of the subroutine arguments. You did not show the declarations of Kglobal, ipiv and force; that is where the answers to the question are likely to be found.

here is the relevant part of my code


real ,dimension(882,1) :: force,displacement

integer ,dimension(882,1) :: piv

real ,dimension(882,882) :: Kglobal

!using math kernel library

call getrf(Kglobal,piv)
call getrs(Kglobal,piv,force)
do ii = 1,50
  print *,displacement(ii,1)
end do

i am getting the same error......suggest me how solve this error


The arrays pivot and force are not matched to the requirement (from the interface declaration of getrf and getrs) that they be one-dimensional arrays. EIther change the declarations of these two or change the calls to call getrf(Kglobal,piv(:,1)) and call getrs(Kglobal,piv(:,1),force(:,1)).

anpther error

dhananjay@ubuntu:~/Desktop/fortran_practice$ ifort beta4.f90 -mkl -I$MKLROOT/include/ia32
/tmp/ifortimvmYV.o: In function `MAIN__':
beta4.f90:(.text+0x242b): undefined reference to `sgetrf_f95_'
beta4.f90:(.text+0x250d): undefined reference to `sgetrs1_f95_'

You need to give the linker information on where to find the lapack95 library.   Add this to your ifort command


In general when you put a "use" statement in your code you'll need to pass a -I option with a path that include the .mod for the module and also either a path to the .a (static) file for the library or -L path -l module (dynamic) to specify path and name of the library.

You can use this as a quick reference to get hints on what paths and flags you need to pass the compiler for various uses of MKL: /opt/intel/composer_xe_2013.3.163/Documentation/en_US/mkl/mkl_link_line_advisor.htm  (assuming your installation is in /opt/intel, adjust accordingly)

Leave a Comment

Please sign in to add a comment. Not a member? Join today