Bogus output on Wintel but good on SiliGee

B

Bill

I get bad results from a console-mode (no GUI), number-cruncher, C++
program when I run it on a Wintel box running Windows 2000 Pro, after
compiling it with Microsoft Visual C++. This very same code runs
correctly when run on a Silicon Graphics machine running IRIX 6.5,
after compiling it with the MIPSpro C++ compiler (CC).

The results on the Wintel machine are only a little off when running
in debug mode, but are total garbage when the release version is run.

Any ideas?
 
V

Victor Bazarov

Bill said:
I get bad results from a console-mode (no GUI), number-cruncher, C++
program when I run it on a Wintel box running Windows 2000 Pro, after
compiling it with Microsoft Visual C++. This very same code runs
correctly when run on a Silicon Graphics machine running IRIX 6.5,
after compiling it with the MIPSpro C++ compiler (CC).

The results on the Wintel machine are only a little off when running
in debug mode, but are total garbage when the release version is run.

Any ideas?

The difference between release and debug versions of your program
is most likely due to the fact that MS compiler initialises all
variables to something meaningful in debug and leaves uninitialised
objects as is in release. So, check your code to see if you rely
on some variable being 0 upon creation. For example

double a;

leaves 'a' uninitialised. In debug mode MSVC++ will make it 0. In
release mode you get garbage in it. If you create some kind of
accumulator

double integral;
for (blahblah)
integral += some_formula();

then, since 'integral' has never been initialised to 0, you add to
some random value.

Of course, it could be something else...

Victor
 
S

Stephen Howe

Any ideas?

Consult a psychic. You will get some answers.

Without any _minimal_ code from you that illustrates the problem, what can
we tell?

Stephen Howe
 
N

not telling

I get bad results from a console-mode (no GUI), number-cruncher, C++
program when I run it on a Wintel box running Windows 2000 Pro, after
compiling it with Microsoft Visual C++. This very same code runs
correctly when run on a Silicon Graphics machine running IRIX 6.5,
after compiling it with the MIPSpro C++ compiler (CC).

The results on the Wintel machine are only a little off when running
in debug mode, but are total garbage when the release version is run.

Any ideas?

Is there a possibility that the program is reading binary data files and
that the endianism is different?
 
J

Jerry Coffin

[ ... ]
Is there a possibility that the program is reading binary data files and
that the endianism is different?

Minimal -- if the problem was in the data file, chances are that there
would be little or no variation between debug and release modes on the
same machine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top