Subroutine Call and LAPACK Utility Function

Subroutine Call and LAPACK Utility Function

Samuel A.'s picture

Hi,

I'm trying to run a very simple code that finds machine epsilon with DLAMCH from LAPACK utility function and calls some random subroutine afterward. When I try to run this code, the error I get is:

error #6404: This name does not have a type, and must have an explicit type.   [DLAMCH]

PROGRAM Check
IMPLICIT NONE
!DEC$ NOFREEFORM
      include 'mkl_lapack.fi'
!DEC$ FREEFORM
    Real*8 eps
    eps  = DLAMCH('E')
    Call SubTest
End Program
SUBROUTINE SubTest
    Write(*,*) 'Test'
Return
END

However, when I remove all the lines related to the subroutine SubTest, the code can be compiled just fine. Why do I receive this error when calling a subroutine? Any help is appriciated.

Samuel

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Gennady Fedorov (Intel)'s picture

that's strange, all looks ok with this example. I was able to compile this example with 32bit version of ifort and intel mkl. 

Samuel A.'s picture

Thanks for your response.

I do agree that this is strange. It is possible that I did not set up MKL correctly. The only thing I changed in the project property page is: Fortran > Use Intel Math Kernel Library --> Parallel (/Qmkl:parallel). Is there anything else I should change?

By the way, I'm using Intel Visual Fortran Compiler XE 12.1 and MKL 10.3 on Windows 7 Professional 64bit.

mecej4's picture

Quote:

When I try to run this code, the error I get is:

error #6404: This name does not have a type, and must have an explicit type. [DLAMCH]


This is a compile-time error, and causes the build to fail. You could not have really "run" the code. Since the interface to DLAMCH is contained within mkl_lapack.fi, one cannot receive the compile time error if that file had been properly INCLUDEd.

It is possible to get confused about which version of the program source is being used if one edits the source outside VisualStudio and does not do a build update before running again.

Quote:


The only thing I changed in the project property page is... Is there anything else I should change?

Note that we (the readers of this thread) do not know what the property settings were before you made this single change, unless they are the same as the default settings that exist immediately after installing the compiler package.
Samuel A.'s picture

This is a compile-time error, and causes the build to fail. You could not have really "run" the code. Since the interface to DLAMCH is contained within mkl_lapack.fi, one cannot receive the compile time error if that file had been properly INCLUDEd. It is possible to get confused about which version of the program source is being used if one edits the source outside VisualStudio and does not do a build update before running again.

You are absolutely right in that I could not "run" without compiling. Thanks for catching my typo. I received the error after trying to "compile" my code.

Note that we (the readers of this thread) do not know what the property settings were before you made this single change, unless they are the same as the default settings that exist immediately after installing the compiler package.

I installed ifort a few days ago, and since then, the single change was made. Therefore, the previous setting was the default setting.

mecej4's picture

Your example code builds and runs fine with IFort-x64 12.1.7.371 and MKL 10.3.12 on Win7-X64. Was error #6404 the only error reported, or did you see either

dla.f90(2): error #7881: This module file was generated for a different platform or by an incompatib le compiler or compiler release. It cannot be read.   [MKL_LAPACK] use mkl_lapack ----^

or

dla.f90(2): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MKL_LAP ACK] use mkl_lapack ----^

or similar messages arising from a failure to find the INCLUDE file 'mkl_lapack.fi'?

Samuel A.'s picture

Here is the output I get from compiling the project.

1>------ Build started: Project: MKL_Check, Configuration: Debug Win32 ------
1>Compiling with Intel(R) Visual Fortran Compiler XE 12.1.1.258 [IA-32]...
1>Check.f90
1>C:\Users\Jun\Documents\Research\YIP Electron Gun Model\Test Programs IVF\MKL_Check\Check.f90(9): error #6404: This name does not have a type, and must have an explicit type.   [DLAMCH]
1>compilation aborted for C:\Users\Jun\Documents\Research\YIP Electron Gun Model\Test Programs IVF\MKL_Check\Check.f90 (code 1)
1>

I don't see any other error such as error #7881 and #7002. The program does compile and run when I comment lines 8, 10-13. Also, when I output the results for DLAMCH for the code without lines 8, 10-13, the outputs are as expected. The compilation error occurs only when I add the subroutine call.

Login to leave a comment.