<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5848" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2>Hi.</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>As promised in my
previous mail, I do indeed have a help request involving WrapITK.
</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>So far it is just
about building ITK with the correct options enabled. I get a Python error
previously I just did not build with the Python option so I have not encountered
this.</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>Some googleing
reveals that this is a long-standing 'feature' of python ...</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2></FONT></SPAN><SPAN
class=551595110-19082009><FONT face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>So how do other
people manage to build it? </FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>Somehow the build
process gets to swigrunPython.cxx without the cpp macro SIZEOF_LONG being
defined, it seems. </FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>There may be a
second issue here, why does the value which appears to be defined in the
CMakeCache (below) not get passed along to the building of this
part.</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009></SPAN><SPAN class=551595110-19082009><FONT
face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>The test at line 679
of pyport.h then fails, as the test of whether SIZEOF_LONG is defined is never
done.</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>Thanks in
advance,</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2>Robert</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>More info
below:</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>A little test
program of mine reveals that the actual required constant LONG_BIT is correct
for this platform, in contrast to what the build message
says.</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>build64]$
./longbit<BR>LONG_BIT = 64<BR>SIZOF_LONG = 0 <BR>LONG_MAX =
9223372036854775807</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>Platform is RedHat
EL5 with locally installed Python2.6.2 </FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>g++ --version says:
g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>ITK is from CVS as
is cableSwig. (Yesteday)</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>Last output of
make:</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>82 [ 74%] Building
CXX object
Wrapping/CSwig/SwigRuntime/CMakeFiles/SwigRuntimePython.dir/swigrunPython.o<BR> 83
In file included from
/dls_sw/apps/python/2.6.2/include/python2.6/Python.h:58,<BR> 84
from
/home/kny48981/sources/ITK_cvs/build64/Wrapping/CSwig/SwigRuntime/swigrunPython.cxx:30:<BR> 85
/dls_sw/apps/python/2.6.2/include/python2.6/pyport.h:685:2: error: #error
"LONG_BIT definition appears wrong for platform (bad gcc/glibc
config?)."<BR> 86 make[2]: ***
[Wrapping/CSwig/SwigRuntime/CMakeFiles/SwigRuntimePython.dir/swigrunPython.o]
Error 1<BR> 87 make[1]: ***
[Wrapping/CSwig/SwigRuntime/CMakeFiles/SwigRuntimePython.dir/all] Error
2<BR> 88 make: *** [all] Error 2<BR></FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>This information can
be fount in CMakeCache.txt:</FONT></SPAN></DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009><FONT face=Arial size=2>1268 //Result of
CHECK_TYPE_SIZE<BR>1269 CMAKE_SIZEOF_LONG:INTERNAL=8</FONT></SPAN><SPAN
class=551595110-19082009><FONT face=Arial size=2></DIV>
<DIV><BR></DIV></FONT></SPAN>
<DIV><SPAN class=551595110-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=551595110-19082009>
<DIV><SPAN class=561113009-19082009>
<DIV><SPAN class=561113009-19082009><FONT face=Arial
size=2>/dls_sw/apps/python/2.6.2/include/python2.6/pyport.h</FONT></SPAN></DIV>
<DIV><SPAN class=561113009-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=561113009-19082009><FONT face=Arial size=2>This appears to be a
bug in python. In the above file, at lines 655-686, a series of macros is
tested, however the case in which LONG_MAX is defined but SIZEOF_LONG is not
actually defined is not covered. This appears to be the case on this platform
and the 'error' test fails, even though LONG_BIT is defined correctly (because
SIZEOF_LONG appears not to be defined)</FONT></SPAN></DIV>
<DIV><SPAN class=561113009-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=561113009-19082009><FONT face=Arial><FONT size=2>The python
developers appear to disagree and say it's a bug in the compiler, though it
is obvious to me that this test at line 679 should not be reached if
either of the operands of the test are not defined, it exits on error when in
fact the condition it is supposed to be testing (whether a 'long' is 32 or 64
bits) is correct.<SPAN class=551595110-19082009> So at the very least, the wrong
error message is produced. If SIZEOF_LONG is required to be present this should
be tested first. But I mustn't argue about that here , though I feel that 'deaf
ears' will be the outcome of going to the python list based on my reading of the
historical entries about this issue there.</SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=561113009-19082009><FONT face=Arial><FONT size=2><SPAN
class=551595110-19082009></SPAN></FONT></FONT></SPAN></SPAN><SPAN
class=561113009-19082009></SPAN><SPAN class=561113009-19082009><FONT face=Arial
size=2></FONT></SPAN> </DIV></DIV>
<DIV><SPAN class=561113009-19082009><FONT face=Arial size=2>655 /* limits.h
constants that may be missing */<BR>656<BR>657 #ifndef INT_MAX<BR>658 #define
INT_MAX 2147483647<BR>659 #endif<BR>660<BR>661 #ifndef LONG_MAX<BR>662 #if
SIZEOF_LONG == 4<BR>663 #define LONG_MAX 0X7FFFFFFFL<BR>664 #elif SIZEOF_LONG ==
8<BR>665 #define LONG_MAX 0X7FFFFFFFFFFFFFFFL<BR>666 #else<BR>667 #error "could
not set LONG_MAX in pyport.h"<BR>668 #endif<BR>669 #endif<BR>670<BR>671 #ifndef
LONG_MIN<BR>672 #define LONG_MIN (-LONG_MAX-1)<BR>673 #endif<BR>674<BR>675
#ifndef LONG_BIT<BR>676 #define LONG_BIT (8 * SIZEOF_LONG)<BR>677
#endif<BR>678<BR>679 #if LONG_BIT != 8 * SIZEOF_LONG
//<<<<<<<<<<<<******* THIS IS REACHED EVEN
IF THE MACRO IS UNDEFINED!!!!<BR>680 /* 04-Oct-2000 LONG_BIT is apparently
(mis)defined as 64 on some recent<BR>681 * 32-bit platforms using
gcc. We try to catch that here at compile-time<BR>682 * rather than
waiting for integer multiplication to trigger bogus<BR>683 *
overflows.<BR>684 */<BR>685 #error "LONG_BIT definition appears wrong for
platform (bad gcc/glibc config?)."<BR>686
#endif<BR>687<BR></FONT></SPAN></DIV></SPAN></DIV>
<br><P align=justify>This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.<BR>Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. <BR>Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.<BR>Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom<BR> </P>
<br></BODY></HTML>