Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29277 Discussions

Error in opening the compiled module file

Mike896
Beginner
16,021 Views

Hi,

I have a project which will create static library. I use it a lot and it was ok.

Now, when it is compiled, it shows many errors such as:

error #7002: Error in opening the compiled module file. Check INCLUDE paths.

I rebuild the solution. Errors are still the same.

The source files are all put in a directory. So I think I don't need to set the Additional Include Directories.

What are the possible problems?

Thank you in advance.

Mike

0 Kudos
20 Replies
Mike896
Beginner
15,937 Views
Quoting - Mike896

Hi,

I have a project which will create static library. I use it a lot and it was ok.

Now, when it is compiled, it shows many errors such as:

error #7002: Error in opening the compiled module file. Check INCLUDE paths.

I rebuild the solution. Errors are still the same.

The source files are all put in a directory. So I think I don't need to set the Additional Include Directories.

What are the possible problems?

Thank you in advance.

Mike

It's very strange.

That library worked well before. Now, I add a subroutine.

Then it has this error.

I comment the added subroutine.

Rebuild it. There is no error.

After uncommentting it, there is no error again.

How come?

Mike

0 Kudos
Jugoslav_Dujic
Valued Contributor II
15,937 Views
Quoting - Mike896

It's very strange.

That library worked well before. Now, I add a subroutine.

Then it has this error.

I comment the added subroutine.

Rebuild it. There is no error.

After uncommentting it, there is no error again.

How come?

Mike

I don't have enough data to debug the problem, just a couple of hints:

  • The message "Error in opening the compiled module file" means that the compiler can not locate the .mod file. The Foo.mod file is expected when compiler encounter "USE Foo" in a source file.
  • That message is normally accompanied with a module name (although I didn't check in 11.0) -- is it?
  • When you use MODULEs and build them in a static library, you (usually) also need to distribute the .mod files along with the lib, in order to build the .exe. (Or give the compiler the appropriate INCLUDE path). Is that the caes, or you're encountering the problem while building the .lib itself?

If you don't use MODULEs at all, you might have encountered a compiler bug. A wild guess for a workaround is that you remove /gen-interfaces (Fortran/Diagnostics) and /check-interfaces, but that's just a wild guess. You should give us some more data to work with.

0 Kudos
Mike896
Beginner
15,937 Views
Quoting - Jugoslav Dujic

I don't have enough data to debug the problem, just a couple of hints:

  • The message "Error in opening the compiled module file" means that the compiler can not locate the .mod file. The Foo.mod file is expected when compiler encounter "USE Foo" in a source file.
  • That message is normally accompanied with a module name (although I didn't check in 11.0) -- is it?
  • When you use MODULEs and build them in a static library, you (usually) also need to distribute the .mod files along with the lib, in order to build the .exe. (Or give the compiler the appropriate INCLUDE path). Is that the caes, or you're encountering the problem while building the .lib itself?

If you don't use MODULEs at all, you might have encountered a compiler bug. A wild guess for a workaround is that you remove /gen-interfaces (Fortran/Diagnostics) and /check-interfaces, but that's just a wild guess. You should give us some more data to work with.

Thank you very much for your reply, Jugoslav. Your informations are always helpful.

The problem now I figure out is due to cyclic dependency, as I also encounter repeated compiling even without any modification of programs. I have also posted in http://software.intel.com/en-us/forums/showthread.php?t=62386.

Mike

0 Kudos
wmaquite
Beginner
15,937 Views
Hi,

I'm getting a similar error that I haven't been able to solve. I'm just trying to check that the IMSL Library was properly installed following http://www.vni.com/tech/imsl/gettingStarted/using/use_for_win.php

But I get this Error:

Error 1 error #7002: Error in opening the compiled module file. Check INCLUDE paths. [LSARG_INT]

I have added the \IA32\include\DLL to Project->Properties->ConfigurationProperties -> Fortran->General, "AdditionalIncludeDirectories"

How can I prove that such path is properly set?

Thank you,
0 Kudos
Jugoslav_Dujic
Valued Contributor II
15,937 Views
In the additional include directory, there should be a file LSARG_INT.mod -- is it there?
0 Kudos
Steven_L_Intel1
Employee
15,937 Views
Do not use in the Visual Studio settings - that's a placeholder for the actual path. You may be able to use $(FNL_DIR) instead. I prefer to add this under Tools > Options > Intel Visual Fortran > Compilers. Add the path to the IMSL libraries here too.

I suggest following the instructions in the Intel Fortran documentation under Building Applications > Using Libraries > Using IMSL
0 Kudos
wmaquite
Beginner
15,937 Views
I actually added it as C:\Program Files\VNI\imsl\fnl600\IA32\include\dll in Includes and as C:\Program Files\VNI\imsl\fnl600\IA32\lib in the Libraries.

I also followed the instructions as you suggested. Not even adding the imsl.lib and imsl_dll.lib libraries in the Source files helped.

I still get the same error.

Thank you,
0 Kudos
wmaquite
Beginner
15,937 Views
Hi Jugoslav. Yes, that files is there.

Thank you,
0 Kudos
Steven_L_Intel1
Employee
15,937 Views
Please attach the build log for the failed build.
0 Kudos
wmaquite
Beginner
15,936 Views
Here it is.

Thanks for your help,

Will
0 Kudos
Steven_L_Intel1
Employee
15,937 Views
When you entered the path for the Include files, you inserted a blank at the beginning. Take it out.
0 Kudos
wmaquite
Beginner
15,937 Views
Oh thank you. Now the example works.
0 Kudos
sawado
Beginner
15,937 Views
Hello everybody,

I have a similar problem. I want to use fftw3 library in a fortran program. I downloaded the DLLs from fftw.org and I extracted the .lib files with:
lib /def:libfftw3-3.def
My code is similar to:
[bash]    
    Program bFFTW
    
   ! use libfftw3
    !DEC$ OBJCOMMENT LIB:'libfftw3.lib'
    
    integer :: Num,jres,L
    double precision :: AIN(10**6),ATIME(20)
    double complex :: AOUT(10**6)
         
 
     -------------------
     
     CALL cFFTW(AIN,AOUT,N)       
                                           
    Contains
        
        subroutine cFFTW(Ain,Aout,N)     
        
       !  use libfftwf 
         double precision in,ain
         dimension in(N),ain(10**6)
         double complex out,aout
         dimension out(N/2 + 1),aout(10**6)
         integer*8 plan
         integer I
         
         !DEC$ OBJCOMMENT LIB:'libfftw3.lib'
         
         DO I=1,N
            in(I)=AIN(I)
         END DO       
         
         call dfftw_plan_dft_r2c_1d(plan,N,in,out,FFTW_ESTIMATE)
         call dfftw_execute_dft_r2c(plan, in, out)
         call dfftw_destroy_plan(plan)
       
       end subroutine cFFTW  
   
   end program bFFTW      
     [/bash]
When I try to compile it with ifort, I get the message :
[bash]bFFTW.F90(4) : Error: Error in opening the compiled module file.  Check INCLUDE
paths.   [LIBFFTW3]
    use libfftw3
--------^[/bash]

Can you help me either to add properly the libs in Visual Studio 2005 or to compile and link it with intel fortran 9.1?

Thanks
0 Kudos
Steven_L_Intel1
Employee
15,937 Views
You need to compile the Fortran source that defines module LIBFFTW3. I assume it is included in the distribution. Simply add that source to your project. It has nothing to do with "libs".
0 Kudos
sawado
Beginner
15,937 Views
Thanks for your answer. Actually there is no fortran source for the fftw code since it has been developped in C and compiled to produce some DLLs (http://www.fftw.org/install/windows.html). I want to link my fortran program to those libraries and I failed to make it work.
0 Kudos
Steven_L_Intel1
Employee
15,937 Views
If that's so, then what prompted you to add a "use libfftw3" to your source?

I will comment that if the library is written in C and has lowercase names, you will need some set of declarations of the routines. I presume that's what's supposed to be in a libfftw3 module.
0 Kudos
sawado
Beginner
15,937 Views
>> If that's so, then what prompted you to add a "use libfftw3" to your source?

Because, usually in Fortran, The USE statement is used to include an external library. Is there another way to do it? If, I comment the Use statement and let just this:
[bash]!DEC$ OBJCOMMENT LIB:'libfftw3.lib'[/bash]
I get this error during the compilation:
[bash]bFFTW.obj : error LNK2019: unresolved external symbol _DFFTW_PLAN_DFT_R2C_1D ref
erenced in function _MAIN__
bFFTW.obj : error LNK2019: unresolved external symbol _DFFTW_EXECUTE_DFT_R2C ref
erenced in function _MAIN__
bFFTW.obj : error LNK2019: unresolved external symbol _DFFTW_DESTROY_PLAN refere
nced in function _MAIN__
bfftw.exe : fatal error LNK1120: 3 unresolved externals[/bash]

>> I will comment that if the library is written in C and has lowercase names, you will need some set of declarations of the routines. I presume that's what's supposed to be in a libfftw3 module.

How do I make Fortran understand the lower case subroutines names? That may explane the error above.
0 Kudos
Steven_L_Intel1
Employee
15,937 Views
The USE statement references a Fortran module. It is true that many libraries provide modules to declare interfaces to their routines, but that is not universal.

There are several approaches you can take, but let's start with the simplest. Add these lines in your declaration section:

!DEC$ ATTRIBUTES DECORATE, ALIAS:"dfftw_plan_dft_r2c_1d" :: dfftw_plan_dft_r2c_1d
!DEC$ ATTRIBUTES DECORATE, ALIAS:"dfftw_execute_dft_r2c" :: dfftw_execute_dft_r2c
!DEC$ ATTRIBUTES DECORATE, ALIAS:"dfftw_plan_destroy_plan" :: dfftw_destroy_plan

Now I don't know if these routines need anything else, such as passing some arguments by value. If so, that would require something more. You'll know that you have this issue if you get an access violation on a call.
0 Kudos
sawado
Beginner
15,937 Views
Thank you for your answer,
I have tried this


[bash]Program bFFTW

!DEC$ OBJCOMMENT LIB:'libfftw3.lib' !DEC$ ATTRIBUTES DECORATE, ALIAS:"dfftw_plan_dft_r2c_1d" :: dfftw_plan_dft_r2c_1d !DEC$ ATTRIBUTES DECORATE, ALIAS:"dfftw_execute_dft_r2c" :: dfftw_execute_dft_r2c !DEC$ ATTRIBUTES DECORATE, ALIAS:"dfftw_plan_destroy_plan" :: dfftw_destroy_plan [/bash]



And I get this error:
[bash]bFFTW.F90(6) : Error: Only a function or subroutine subprogram may have the !DEC
$ ATTRIBUTES directive DECORATE specifier.   [DFFTW_PLAN_DFT_R2C_1D]
 !DEC$ ATTRIBUTES DECORATE, ALIAS:"dfftw_plan_dft_r2c_1d" :: dfftw_plan_dft_r2c_1d[/bash]
0 Kudos
Steven_L_Intel1
Employee
13,512 Views
Sigh. Try this instead:

!DEC$ OBJCOMMENT LIB:'libfftw3.lib'
!DEC$ ATTRIBUTES ALIAS:"_dfftw_plan_dft_r2c_1d" :: dfftw_plan_dft_r2c_1d
!DEC$ ATTRIBUTES ALIAS:"_dfftw_execute_dft_r2c" :: dfftw_execute_dft_r2c
!DEC$ ATTRIBUTES ALIAS:"_dfftw_plan_destroy_plan" :: dfftw_destroy_plan
0 Kudos
Reply