FORTRAN Inconsistencies...

Andrew Stone ston1957@bellsouth.net
Fri Jul 12 15:59:00 GMT 2002


Hello all,

First off, I apologize if this is not the correct forum for this.

I am working on a FORTRAN port from the Salford compiler
to the g77 compiler for too many reasons to list.  Everything
is good so far, have wrapped the FORTRAN with C++, that is being
called by JAVA via JSP.

Here's the odd thing, when I run the process i get, say 54354 as a net
result (543.54)- I don't pass any floats, only integers are used in the
entire process, but I run the same process again (with the exact same input
parameters) and I may get 54354, or 54355, or 54353.  There is never a
variance
of more than three.

I've traced the inputs and outputs all the way through (from the JSP through
the JAVA
object, through the C++ into the FORTRAN) and back out.  The inputs never
change
at any stage, and neither do the outputs. So, I am getting these differences
apparently
based on the same inputs.

First thing that came to mind was rounding, maybe something was missing.
But there are
two reasons I don't think it is.  1) I have run this same process with a
simple java program
(outside the APACHE web environment) and I don't get these inconsistencies
2) This code has
been used for over a decade, I would think someone would have caught this by
now (but you never know).

It's my example of testing outside the JSP/APACHE/TOMCAT environment that is
confusing me.
Essentially the same code calling the same exact same shared object acts
differently?  I was told
that my simple test could be acting the same way but because of the
differences in memory usage
under APACHE/TOMCAT as opposed to running a command line app, it just might
not be so evident.

So...is there a compiler option that organizes the memory usage differently
that may be of help with
this?

Here's my FORTRAN building exerpt:

g77 -ff77 -fPIC -finit-local-zero -fno-automatic -fugly-logint  -c
$source_f -o $object_f

Here's my linking exerpt:

gcc -ff77 -fPIC  -finit-local-zero -fno-automatic -fugly-logint -shared -mim
pure-text
      -o libjniCheck.so -I/usr/java/include -I/usr/java/include/solaris
      cbdNative.cpp objects/*.o -lg2c -lm -lc -lgcc

That's it...any clues or hints where to go instead of here would be greatly
appreciated.

thanks,
andy



More information about the Gcc-help mailing list