[Insight-developers] Rounding functions in itkMacro.h

Tom Vercauteren tom.vercauteren at m4x.org
Wed May 20 05:41:48 EDT 2009


Hi Sean,

>>I am not familiar
>>with powerpc but these failures might be related to __powerpc__ not
>>being defined on ppc64. Apparently, __ppc64__ should be defined in
>>this case. So changing:
>>  #if defined(__GNUC__) && (!defined(__APPLE__)  || !defined(__ppc__) )
>>by
>>  #if defined(__GNUC__) && (!defined(__ppc__))  && (!defined(__ppc64__))
>>in
>>  vnl_math.h
>>seems like a potential fix to me.
>
> A 'defined(__ppc__), defined(__ppc64__)' test is legit, Apple's headers
> do it sometimes too.  As for "__powerpc__" I have never seen that one,
> and just searched Apple's headers and it appears nowhere.  I would stay
> away from it.

Sorry __powerpc__ was a typo, it should have been __ppc__ which is
what is used in vnl_math.h:
http://www.itk.org/cgi-bin/viewcvs.cgi/Utilities/vxl/core/vnl/vnl_math.h?root=Insight&sortby=date&view=markup


> But what are we really testing for here?  Is this 'fast impl' Intel
> only?  If so, why not test _for_ Intel, instead of not PowerPC?  Note
> that Mac OS X also builds on ARM (for iPhone), though I'm not sure
> anyone is using ITK there (yet).

Absolutely right, what we should test is whether we are on a x86
platform. Changing
  #if defined(__GNUC__) && (!defined(__GCCXML__)) &&
(!defined(__ppc__)) && (!defined(__ppc64__))
by something like
  #if defined(__GNUC__) && (!defined(__GCCXML__)) &&  (defined(i386)
|| defined(__i386__) || defined(__i386) || defined(__x86_64__) ||
defined(__x86_64))
in vnl_math.h would indeed make more sense. I am just not completely
sure what the correct way for testing for x86 with gcc is. There might
be a better cmake way of doing this. Also I won't be here to track
potential dashboard failures until next Monday.

Anyone willing to take over until then? A tentative patch is included.
The schedule in
http://www.itk.org/Wiki/ITK_Release_Schedule#Release_3.14_Schedule
seems not completely up-to-date so I am not sure I will be allowed to
commit more bug fixes on Monday 25th and track the dashboard for a few
days.

Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itk-vnl_math-x86-2009-05-20.patch
Type: text/x-patch
Size: 929 bytes
Desc: not available
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090520/945cbfcf/attachment.bin>


More information about the Insight-developers mailing list