Re: Compiling in 32 vs 64 platform problem



"Peter" <xf.10.kaminari@xxxxxxxxxxxxxxx> wrote in message
news:pq3t429vo6o2k840015357l7sta37ihmok@xxxxxxxxxx
Hello,

I have a several thousand-lines code in f77 that I want to port to 64
bit architecture machines. I use Intel Fortran compiler version 8.1.
with the following command line:

ifort -c -O2

followed by linking of the different object files.

The program is self-contained in the sense that it does not require
any external libraries (except the portability library specified by
the -Vaxlib switch at linking time). Compilation and linking seem to
go smoothly but the results obtained from the program differ from
those that I get on 32 bit architecture machines. Comparing the result
files on both systems one can see difference in values that start on
the second decimal place between the 32 bit results and the 64 bit
results. For example:

64 bit results:

7.5 1 0.664139E-01 1
0.238612E+00
0.531925E-02
0.154969E-01
0.382009E-01

32 bit results:
7.5 1 0.581779E-01 1
0.239058E+00
0.543676E-02
0.155693E-01
0.383326E-01

I have compiled the same code on many different 32 bit machines (also
with the same compiler) and the results usually do not differ by that
much. Thus, I am concerned that something else is happening here but I
am not sure what.

Your results are almost completely different.
That suggests that your program has bugs.
These could be
1. uninitialized variables
2. Subscript errors.
3. Others (see below*).
You need to compile in debug mode.
Why not try the Salford Fortran 95 compiler,
which offers checks for these kinds of errors.
==============
* You say you are using F77 and COMMON.
Both these are error-prone.
You don't say, but are you using IMPLICIT NONE ?
If not, you're best advised to put in declarations for
all variables and to use IMPLICIT NONE.
By not using IMPLICIT NONE, typos can easily
slip though, such as using O instead of 0 and vice versa,
I instead of 1 and vice versa, and so on.


.



Relevant Pages

  • Re: Compiling in 32 vs 64 platform problem
    ... I use Intel Fortran compiler version 8.1. ... those that I get on 32 bit architecture machines. ...
    (comp.lang.fortran)
  • Re: Compiling in 32 vs 64 platform problem
    ... I use Intel Fortran compiler version 8.1. ... those that I get on 32 bit architecture machines. ... If you decide the original code was wrong, having a test framework will help demonstrate the problem to sceptical long-time users of the original code. ...
    (comp.lang.fortran)
  • Re: Intel Fortran 9.0 and 9.1 using VS 2005
    ... Mainly because we never found a bug in over 20 years of use of MS F77 ... In fact any mix of MSDOS and command-line wersions would run ... He also migrated with the compiler owership. ... Intel is like Fort Knox. ...
    (comp.lang.fortran)
  • Re: Vexing problems arising from mixing F9x and F77 code
    ... Similar problems can occur when calling older F77 routines from F9x callers. ... Compiling the main and the subroutine using the same compiler works: ... TST> g95 iotest.f90 f77sub.f ... If you are not amused yet, try using f95 instead of g95, but still use ...
    (comp.lang.fortran)
  • Re: g77 compliance?
    ... G77 complies with the Fortran 77 standard ... a compiler noncompliant with the standard. ... F95 is a superset of f77. ... > stores them in arrays of pointers to arrays). ...
    (comp.lang.fortran)