[Insight-developers] Insight-developers Digest, Vol 55, Issue 6

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Nov 7 08:10:17 EST 2008


'lo,

  I had the exact same issue on the GDCM project. Most people are not
comfortable with cmake and simply use the default value. What I ended
up doing is:
1. Set some better flags when building a release of GDCM (even numbering)
2. When not in release (odd numbering), leave all defaults, since it
means advanced users.

something like:

IF(GDCM_MINOR_VERSION MATCHES "[02468]$")
  IF(NOT CMAKE_BUILD_TYPE)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
  ENDIF(NOT CMAKE_BUILD_TYPE)
  SET(GDCM_BUILD_TESTING_DEFAULT OFF)
ELSE(GDCM_MINOR_VERSION MATCHES "[02468]$")
  SET(GDCM_BUILD_TESTING_DEFAULT ON)
ENDIF(GDCM_MINOR_VERSION MATCHES "[02468]$")


2cts

On Fri, Nov 7, 2008 at 10:33 AM, Tom Vercauteren
<tom.vercauteren at m4x.org> wrote:
> Hi David,
>
> My goal wasn't to perform a comparison with other libraries. I just
> wanted to make sure that newcomers could benefit from ITK as much as
> possible.
>
> I thought that the default mode was debug, but I might be wrong since
> I always explicitly mention what kind of build I need... This
> discussion actually stems from a feedback I had a few days ago on the
> performance of the demons algorithm.
> Me : "First of all, you should make sure that you compile ITK and the
> diffeomorphic demons in Release mode."
> User : "I've recompiled ITK in release mode, and then Demons... Thank
> you very much, it now runs +/- 3.14 times faster. It was a very good
> advice :-)"
>
> Anyhow, this is the kind of discussion I have also seen several times
> on the insight-users mailing list.
>
> Regards,
> Tom
>
> On Thu, Nov 6, 2008 at 6:44 PM, David Fuentes <fuentesdt at gmail.com> wrote:
>>
>> I thought default was without any
>>
>>    -g -O?
>>
>> compilers flags.
>> this would default to -O2 on most compilers? what are you comparing "slow"
>> to? what kind of performance differences are you seeing w/ and w/o Release
>> mode?
>>
>>
>>
>> df
>>
>>
>>
>>
>>
>>> Message: 3
>>> Date: Thu, 6 Nov 2008 17:34:19 +0100
>>> From: "Tom Vercauteren" <tom.vercauteren at m4x.org>
>>> Subject: [Insight-developers] Should default compile mode be Debug,
>>>        Release or RelWithDebInfo?
>>> To: ITK <insight-developers at itk.org>
>>> Message-ID:
>>>        <28392e8b0811060834o57018b4aof7f0d4c9e4563c34 at mail.gmail.com>
>>> Content-Type: text/plain; charset=ISO-8859-1
>>>
>>> Hi all,
>>>
>>> It seems that many new ITK users find ITK slow. Part of this is of
>>> course based on some truth, but in many cases it ends up by
>>> "OK, I didn't know I had to compile in Release mode."
>>>
>>> So I am wondering whether it wouldn't be easier if, by default, ITK
>>> was build in Release mode (or maybe RelWithDebInfo).
>>>
>>> Indeed, I would expect that people that need ITK in debug mode are
>>> people that know how to use a debugger and hence can manage to find
>>> the adequate CMake option to switch to Debug.
>>>
>>> On the other hand newbies are less likely to know how to use a
>>> debugger, won't tweak with CMake options and expect things to run
>>> fast.
>>>
>>> Any thoughts?
>>>
>>> Tom
>>>
>>>
>>> ------------------------------
>>>
>>> _______________________________________________
>>> Insight-developers mailing list
>>> Insight-developers at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>
>>>
>>> End of Insight-developers Digest, Vol 55, Issue 6
>>> *************************************************
>>>
>>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>



-- 
Mathieu


More information about the Insight-developers mailing list