Showing results for 
Search instead for 
Did you mean: 

Backwards compatibility between intel 18 and intel 17 ifort compilers


I'm using ifort (intel 18) to compile this module:

     module test
     integer:: a
       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!'

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?


0 Kudos
3 Replies
Black Belt

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.

0 Kudos
Valued Contributor I

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. 

0 Kudos

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.


0 Kudos