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

difference on 32 and 64-bit system

zhubq
Beginner
749 Views
I am compiling a fortran code by 2011 intel fortran in my Ubuntu linux OS. The results of my progrom compiled on both 32 and 64 systems are the same. But when I change the compilation option to -autodouble or -r8, there is a problem coming up. First of all, there are warnings :Because of COMMON, the alignment of object is inconsistent with its type.
I think the warning is fine because the results of my program is the same as -r4 when I compile on 64 OS.
but when I compile on 32 OS, the results are wrong.
I am not sure whether this is because of my code or the compiler itself. But it seems my code has no problem.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
749 Views
The warning can be ignored - it is warning of a possible performance issue, but correctness should not change.

I always recommend against switches such as -r8 because iit hides the programmer's intentions. The problem you have is almost certainly due to some variable or function being declared with an explicit REAL*4, which doesn't double with -r8. I have seen exactly the symptom you describe and it happens because of the way function values are returned on the two platforms.

First thing I would suggest is to compile everything with "-warn interface" and see if you get new errors. That the code works sometimes doesn't mean it "has no problems".
0 Kudos
Reply