[Insight-developers] VC++ Debug/Release float/double preci sion and Schrodinger's Cat.

Bill Hoffman bill.hoffman@kitware.com
Mon, 15 Apr 2002 12:34:05 -0400


These are advanced features, you can set them in cmake already.

You can change:
CMAKE_CXX_FLAGS   // these flags are added to the compile line for all configurations

There are also these flags:
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELWITHDEBINFO

Which are added to the specific configuration.   (Note there is already a
optimize for size version).

I do not think we need more configurations or options for cmake.
However, the defaults should work.   Most applications (VTK, etc) will
work with the MS standard Release build.   If ITK does not, then we need
to fix the code to do the right thing with floating point calculations so
it does.    This really has to do with testing coverage, and being careful
with floating point and double operations.

-Bill




At 12:09 PM 4/15/2002 -0400, Luis Ibanez wrote:

>Jim,
>
>Yeap, That's it.
>
>Enabling  "Floating-Point Consistency" in VC++
>produce the right results for the example.
>
>So...      what do we do ?
>
>Should we maybe add a VC++ option in CMake ?
>something like:
>
>     VC++_USE_IEEE_FLOATING_POINT
>
>The concern is that for this particular example
>it was pretty obvious that something was going
>wrong (just three lines of code !) but the same
>can be happening right now on the internals of
>a Registration method when computing derivatives,
>or in the middle of a watershed segmentation or
>in the fuzzy connectedness filter.
>
>In those cases the complexity of the code involved
>will make almost impossible to realize that improper
>computations are being performed at the low level.
>Just reading the code will not help at all.
>
>Selecting this optimization option will sacrify
>speed but anyways...   running faster is useless
>is the results are wrong       :-/
>
>
>BTW there are other optimization options that
>may eventually be interesting to expose at CMake
>level, for example:
>
> - Favor small code
> - Favor fast code
> - Inline Function Expansion
>
>It could probably be better to set this on the
>Advanced level and preced this options (as VC++
>does) with something like :
>
>     VC++_CUSTOMIZE_OPTIMIZATION
>
>only when this option is "ON", CMake will present
>the detailed optimization options.
>
>
>
>
>Luis
>
>
>=====================================================
>
>Miller, James V (Research) wrote:
>>Just looked up the compiler option.  /Op ensures that all intermediate
>>calculations are done according to IEEE standards.  The downside is that it does this by reading and writing variables to memory instead of leaving
>>them in a register.  The result is that the code is bigger and slower.
>>The /Za option (ANSI compatibility) turns on /Op by default.
>>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_.2f.op.asp
>>
>
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers