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

Module Content Related to Static Libraries

garyscott
Beginner
197 Views
Hi, Was curious as to what is actually contained (generally speaking) in a CVF 6.6C static library built from the following code:
module v9
real :: radar(29) = 32
end module
module version
character(80) :: filename
integer :: ios
contains
integer function trymod
use v9
trymod = radar(1)
end function
end module
I see references to the module content, but it seems almost useless without the separate .mod files (actually it seems entirely unnecessary).
0 Kudos
3 Replies
Steven_L_Intel1
Employee
197 Views
The .lib contains the code for the module procedure and the storage for the module variables. The .mod provides symbol table information about the declarations.
0 Kudos
garyscott
Beginner
197 Views
Ah, since I've always packaged modules in the same file as the main program,I guess I was confused on where the "object" module was stored. I assumed that the .mod file was "complete" (and redundant with the library, but of proprietary format because of the additional content). So in some cases I need both the library and the .mod file but in some cases I only need the .mod file or I always require both (and the object code is simply inherently includedin the single file approach that I typically use)?
Boy that's a pretty fundamental confusion isn't it??
0 Kudos
Steven_L_Intel1
Employee
197 Views
Now you've confused me!
You can simplify things by assuming that you always need the .obj/.lib and the .mod. Sometimes the object code is not needed, but it never hurts...
0 Kudos
Reply