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

module compatibility between ifort versions

sharma_amitraj
Beginner
2,136 Views
hi
I have fortran codes, compiled as modules with ifort version 9.0. I migrated to a newer system, on which ifort 10.1 is installed. when I compile my interface code and use modules compiled with version 9.0. I get the following error.
............This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read............
Is there a way to use modules compiled with older versions of ifort and use them with newer version?

thanks
amit
0 Kudos
11 Replies
Steven_L_Intel1
Employee
2,136 Views

This is supposed to work, but there have been bugs in the past. Can you attach the .mod you are trying to use? Are you compiling for the same platform (IA-32, etc.)?
0 Kudos
sharma_amitraj
Beginner
2,136 Views


This is supposed to work, but there have been bugs in the past. Can you attach the .mod you are trying to use? Are you compiling for the same platform (IA-32, etc.)?

I did not specify the architecture while compiling. However both are x86 machines, here are the details.
machine with ifort-9.0
Linux master 2.6.17-ck1-suse92-osmp #1 SMP Fri Dec 15 13:13:32 EST 2006 x86_64 x86_64 x86_64 GNU/Linux
machine with ifort-10.1
Linux master 2.6.27.8-default #1 SMP Mon Dec 8 17:15:47 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

I will have to get a samle module, coz the real one is really big. Hundereds of fortran modules!!.

Another issue, steve maybe you can help. We are compiling a library, which consists of hundreds of fortran modules. The problem is that the modules are heavily nested. ifort takes a long long time to compile such codes ( about an hour). Is there way to speed up this compilation?
thanks,
amit
0 Kudos
sharma_amitraj
Beginner
2,136 Views
attached is a tar file (tar xvfz 1.tgz to extract) with a sample main program and a test module compiled with ifort 9.0.
you can also see a a.out and .o, these were created with 10.1 version, and should be ignored. so if I try to compile my main program with ifort 10.1, I get this
fortcom: Error: main.f90, line 5: This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read. [FMD_UTIL]
use fmd_util
------^

1.tgz

amit

This is supposed to work, but there have been bugs in the past. Can you attach the .mod you are trying to use? Are you compiling for the same platform (IA-32, etc.)?

0 Kudos
Steven_L_Intel1
Employee
2,136 Views

Thanks - I'll check this out.

Have you tried a current, supported compiler (11.1)?
0 Kudos
sharma_amitraj
Beginner
2,136 Views

Thanks - I'll check this out.

Have you tried a current, supported compiler (11.1)?

I tried version 11.0, and I get the same error.
0 Kudos
Steven_L_Intel1
Employee
2,136 Views

I just tried with 11.1.044 and it worked. Would you please add the -V switch when you do the compile and show me the full output? Do you get the error with a simple:

use fmd_util
end

or is more needed?
0 Kudos
sharma_amitraj
Beginner
2,136 Views

I just tried with 11.1.044 and it worked. Would you please add the -V switch when you do the compile and show me the full output? Do you get the error with a simple:

use fmd_util
end

or is more needed?
yes, I get error with simple use fmd_util (nothing else in the main program, like the sample I sent you). here is the full ouput with -V
ifort -V main.f90

Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20081024 Package ID: l_fc_p_10.1.021
Copyright (C) 1985-2008 Intel Corporation. All rights reserved.

Intel Fortran 10.1-2051
fortcom: Error: main.f90, line 5: This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read. [FMD_UTIL]
use fmd_util
------^
fortcom: Error: main.f90, line 9: This name does not have a type, and must have an explicit type. [C_MASS]
print*, ' mass of carbon ',c_mass
-----------------------------^
compilation aborted for main.f90 (code 1)

amit
0 Kudos
Steven_L_Intel1
Employee
2,136 Views

You're using the Intel 64 (x64) compiler - this won't work with an IA-32 compiler module. In version 10.1, this is done by using the "fce" folder to locate the compiler. Please use "fc" instead to get the 32-bit compiler.
0 Kudos
sharma_amitraj
Beginner
2,136 Views

You're using the Intel 64 (x64) compiler - this won't work with an IA-32 compiler module. In version 10.1, this is
done by using the "fce" folder to locate the compiler. Please use "fc" instead to get the 32-bit comp
my compiler path is /opt/intel/fce/10.1.021/bin/ifort. There is no 'fc' in this directory, does this mean that all the components were not installed? The contenst of 'bin' directory are

codecov fpp ifortbin ifortvars.csh map_opts profmerge profrun pronto_tool uninstall.sh xild
fortcom ifort ifort.cfg ifortvars.sh profdcg proforder profrun.bin tselect xiar


do the modules also need to be compiled with IA-32?
I am installing ifort 11.1.056. I will let you know the outcome with latest version.
amit
0 Kudos
sharma_amitraj
Beginner
2,136 Views

I just tried with 11.1.044 and it worked. Would you please add the -V switch when you do the compile and show me the full output? Do you get the error with a simple:

use fmd_util
end

or is more needed?
I just tried compiling with ifort 11.1.056, my command looks like this

I just tried with 11.1.044 and it worked. Would you please add the -V switch when you do the compile and show me the full output? Do you get the error with a simple:

use fmd_util
end

or is more needed?
I just tried compiling with ifort 11.1.056, my command looks like this

/opt/intel/Compiler/11.1/056/bin/ia32/ifort main.f90
The compiler is looking for 32-bit math libraries and I get the following error
ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../..//libm.so when searching for -lm
ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../..//libm.a when searching for -lm
ld: skipping incompatible /usr/lib64/libm.so when searching for -lm
ld: skipping incompatible /usr/lib64/libm.a when searching for -lm
ld: cannot find -lm

I did a search for libm.a and could not find 32-bit libraries. I guess I will have to install 32-bit libraries. any quick-fix?
amit

0 Kudos
Steven_L_Intel1
Employee
2,136 Views

With 10,1, the path would have been /opt/intel/fc/10.1/...

With 11.1, it seems you are not correctly setting up the ifort environment. As the documentation says, you should use"

souirce /opt/intel/Compiler/11.1/056/bin/ifortvars.sh ia32

(use ifortvars.csh if you're using the C shell). However, doing 32-bit development on an x64 platform requires installation of 32-bit libraries from your Linux distribution. Please carefully read the compiler release notes section on system requirements for details.
0 Kudos
Reply