[ITK Community] Wrapping ITK with homebrewed python on OS 10.8.5

Matt McCormick matt.mccormick at kitware.com
Tue Oct 29 14:01:40 EDT 2013


Hi Michka,

First, thank you very much for maintaining the Homebrew build of ITK!
This is very important.

Thank you for the detailed report.  This is a known issue with GCCXML
and challenges in its maintenance.  As recently as yesterday, we
brainstormed with Brad King, the author of GCCXML, on how to address
these challenges.  As you have discovered, explicit support must be
added to GCCXML to handle the system headers that are specific to each
compiler.  This is very burdensome, and so support is not present for
the new Clang or newer versions of Visual Studio.  A replacement for
GCCXML based on libclang should be more maintainable, but it is an
open question on how the bolus of effort required will take place.

In sum, there is not an easy fix here for the near future.

Thanks,
Matt


> I am currently trying to wrap ITK with python. Python 2.7.5 was installed with homebrew on OS 10.8.5.  tested with ITK 4.4.2.
> The problem is exactly the same on OS 10.7.5.
>
>
> Some relevant options I defined in cmake for ITK :
>
> BUILD_EXAMPLES = OFF
> BUILD_DOCUMENTATION = OFF
> BUILD_TESTING = OFF
> BUILD_SHARED_LIBS = ON
> CMAKE_BUILD_TYPE = Release
> Module_ITKVtkGlue = ON
> ITK_WRAP_PYTHON = ON
> PYTHON_EXECUTABLE = /usr/local/bin/python
> PYTHON_INCLUDE_DIR = /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7
> PYTHON_LIBRARY = /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
> ITK_USE_SYSTEM_GCCXML = OFF
> ITK_WRAP_GCCXML = ON
> CMAKE_CXX_COMPILER = /usr/bin/c++
> CMAKE_C_COMPILER = /usr/bin/cc
>
> Gccxml compiles correctly, but then when trying to generate the first xml file (Generating vcl_complex.xml), it fails :
>
> In file included from /usr/include/c++/4.2.1/cstddef:51,
>                  from /usr/include/c++/4.2.1/cstring:51,
>                  from /usr/include/c++/4.2.1/bits/char_traits.h:45,
>                  from /usr/include/c++/4.2.1/string:47,
>                  from /tmp/insighttoolkit-nNsV/InsightToolkit-4.4.2/Modules/Core/Common/include/itkMacro.h:46,
>                  from /tmp/insighttoolkit-nNsV/InsightToolkit-4.4.2/Modules/Core/Common/include/itkLightObject.h:21,
>                  from /tmp/insighttoolkit-nNsV/InsightToolkit-4.4.2/Modules/Core/Common/include/itkObject.h:31,
>                  from /tmp/insighttoolkit-nNsV/InsightToolkit-4.4.2/Modules/Core/Common/include/itkCommand.h:21,
>                  from /tmp/insighttoolkit-nNsV/InsightToolkit-4.4.2/itk-build/Wrapping/Modules/ITKCommon/vcl_complex.cxx:1:
> /usr/bin/../lib/clang/5.0/include/stddef.h:29:42: error: missing binary operator before token "("
> /usr/bin/../lib/clang/5.0/include/stddef.h:37:39: error: missing binary operator before token "("
> /usr/bin/../lib/clang/5.0/include/stddef.h:48:42: error: missing binary operator before token "("
>
> I played a little bit around and was wondering about why there are two cstddef files, one in /usr/include/c++/, the other in /usr/bin/../lib/clang/ …
>
> I then renamed the /usr/include to /usr/_include (this is a very dirty hack), and the compilation went to the end (and ITK works in python !).
>
> I asked the same question on the gccxml mailing list, and got no answer for the moment.
>
> My questions are the following :
>
> 1) Why are there two includes folders, and to what compilers do they belong ? I guess one is from clang, the other from llvm-g++ ?
> 2) Why does the compilation work when I rename the include folder so that then the compiler can't find it ?
> 3) Is there an options somewhere in cmake to tell gccxml which include folder to use ? Setting the CMAKE_CXX_COMPILER to llvm-g++ is not a solution, you get the same errors.
> 4) What is the status of the support of Clang for wrapping ITK with python ? (OS 10.9 is out, and Clang only)
>
> I would be pleased to do some further tests or to invest some time in fixing this, but my c++ knowledge is rather bad. But once it is working I will upgrade the install formulas in homebrew so that people can install ITK on OS X with an one-liner :)
>
> Michka
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community



More information about the Community mailing list