Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1,437 Views

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

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
Highlighted
Employee
1,437 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.

Highlighted
Beginner
1,437 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
Highlighted
Valued Contributor III
1,437 Views

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

0 Kudos
Highlighted
Black Belt
1,437 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