[Date Prev][Date Next] [Chronological] [Thread] [Top]

[CTSim-Users] errors with compilation options gcc 4



Dan Martin wrote:
> I am making heavy modifications to the software.  The only way I have to 
> verify results is to compare them to the "out of the box" CT Sim 
> results.  Recently I spent 5 days looking for bugs in my code that 
> didn't exist, and eventually replicated the CT Sim code into my program, 
> and I still couldn't get the same results on a 7 X 7 test image.  I 
> finally tried optimizing my compilation with the -O2 option for gcc, and 
> the reults were suddenly the same.

Hi Dan,

Were the differences between gcc with no optimization flag or gcc with
-O compared with -O2?
  
> The configuration files use this option, which apparently [though it 
> should not] breaks the code and leads to inaccurate results. 

You're right, gcc docs say that -O2 should be safe.

> I assume that the optimized executable is the one that is in error, 
> rather than the unoptimized executable, but I have no easy way to tell this.

That's a reasonable assumption. Testing with Intel's Linux C compiler
(or with the CTSim windows binary compiled with MSVC) should provide
another comparison point.

-- 
Kevin Rosenberg
kevin@hypershots.com



Please send sugestions and comments to kevin@ctsim.org.