- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using ifort (intel 18) to compile this module:
module test integer:: a contains subroutine f() end subroutine end module test
To be used with this program compiled with ifort (intel 17):
program ping use test write ( *, '(a)' ) ' Hello, world!' end
But I am getting this error:
test.f90(2): error #7012: The module file cannot be read. Its format requires a more recent F90 compiler. [TEST]
use test
----------^
However, I can compile the module with ifort (intel17) and then 'use' it in a program compiled with ifort (intel18) without any issues.
So, it it looks like the fortran modules are forwards compatible, but not backwards compatible between ifort compiler versions. Is there anything that I can do to get the module to work in the backwards compatible case?
Thanks,
Nick
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you are asking for is that the older compiler to be able to read *.mod files that are in a format that had not been defined when the compiler was built. Usually, this is unlikely to be possible, just as you cannot run a Windows EXE on an old MSDOS machine.
Occasionally, changes to the module file format can be so radical as to make old module files unusable by a new version of the compiler, and new module files have to be generated by recompiling from source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you open the mod file with an editor that can read Hex code, then you will actually see the version number of the compiler which has generated that mod file. So there is an explicit check for the format. As mecej4 already noted, .mod files of different versions of the same compiler are more often incompatible than compatible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can go the other way however. You can build a .mod file with the 17.0 compiler and it can be used by 18.0 or later.
--Lorri

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page