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

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

Elsayed_A_
Beginner
11,001 Views

I am writing a Fortran code for fluid flow in porous media. I am in the debugging stage. The code solves fluid flow equations using LAPCAK.

I have several modules that have specific tasks. for example, INDEXING MODULE is finding the coordinates and node number for every node in the domain. 

I started debugging but I have the following error.

 program main

use INDEXING

end program main

module INDEXING

contains

module procedure

end module INDEXING

 

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

 

Could you please, explain how to fix this issue?

 

Regards

0 Kudos
4 Replies
Kevin_D_Intel
Employee
11,001 Views

You need to rearrange the source so the module source appears ahead of the main program source if those are contained in the same physical Fortran source file. As shown and assuming the code resides in the same source file, the USE INDEXING statement is parsed before the module source is; thus, the compiler throws the error noted since the module has not been compiled to create the needed .mod file that the compiler seeks related to the USE INDEXING statement.

Elsayed_A_
Beginner
11,001 Views

Kevin,

Thanks for your reply. What if put every module in a separate sources file? How should I compile it in this case?

0 Kudos
andrew_4619
Honored Contributor II
11,001 Views

If you are using visual studio it will work out the correct build order automatically.

0 Kudos
mecej4
Honored Contributor III
11,001 Views

Elsayed A. wrote:
What if put every module in a separate sources file? How should I compile it in this case? 

Whether you do so or not, the dependency rule remains the same. Before a program unit that contains a USE <xyz> statement can be compiled, the source code for <xyz> should have been compiled successfully. It follows that if the USE <xyz> and MODULE <xyz> are in the same file, the MODULE part should occur earlier in the file. If they are in separate files, the file containing the module should be compiled first.

0 Kudos
Reply