- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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".
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".

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