[Insight-developers] 32/64 bits universal builds cause itk test
failures.
Mathieu Coursolle
mcoursolle at rogue-research.com
Tue Jul 10 10:57:13 EDT 2007
Hi ITK developpers,
We currently have a private dashboard (OSX) which is doing a universal
32 and 64 bits nightly build
of ITK. (CMAKE_OSX_ARCHITECTURES = i386; x86_64)
However, a lots of ITK tests related to the Nrrd library are failing (~40).
Our ITK build is both 32 and 64 bits (i386 and x86_64). However, the
TEEM_32BIT flag
of the Nrrd library is defined according to the size of a void pointer
when cmake configures.
In the case of a universal 32-64 bits build, that flag cannot be the
same for both builds,
and therefore needs to depend on something else.
We could check in the itkConfigures.h.in for the __LP64__ definition
which tells if an apple
build is 64 bits:
/* 32 or 64 bits. */
/* All compilers that support Mac OS X define __LP64__ if the architecture is
64 bits. */
#if !defined(__APPLE__)
#cmakedefine CMAKE_SIZEOF_VOID_P
#if CMAKE_SIZEOF_VOID_P == 8
#define ITK_32BITS 0
#else
#define ITK_32BITS 1
#endif
#elif defined(__LP64__) && __LP64__
#define ITK_32BITS 0
#else
#define ITK_32BITS 1
#endif
However, in the NrrdIO/CMakeList.txt file, the TEEM_32BIT flag is set
as follow:
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
ADD_DEFINITIONS(-DTEEM_32BIT=0)
ELSE(CMAKE_SIZEOF_VOID_P MATCHES 8)
ADD_DEFINITIONS(-DTEEM_32BIT=1)
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
Is there a way to set TEEM_32BIT to the value of ITK_32BITS definition
at that point?
Example:
# Set compiler flags for 32 or 64 bit architecture (based on the size
# of a void pointer).
IF(APPLE)
ADD_DEFINITIONS(-DTEEM_32BIT=ITK_32BITS)
ELSE(APPLE)
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
ADD_DEFINITIONS(-DTEEM_32BIT=0)
ELSE(CMAKE_SIZEOF_VOID_P MATCHES 8)
ADD_DEFINITIONS(-DTEEM_32BIT=1)
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
ENDIF(APPLE)
It seems like it is always define as 0 if I do this.
Any idea on how this could be solve?
Thank you.
Mathieu
--
____________________________________________________________
Mathieu Coursolle mcoursolle at rogue-research.com
Rogue Research www.rogue-research.com
Montréal, Québec, Canada
More information about the Insight-developers
mailing list