[ITK] [ITK-dev] cannot enable python wrapping in ITK

Michka Popoff michkapopoff at gmail.com
Thu Jun 5 12:07:13 EDT 2014


Normally if you are building with latest git master, you should not be able to build with SWIG 2.0.11
There is a check which asks for 3.0.0. That's why we ship our own swig built as an external project.

I recommend you set ITK_USE_SYSTEM_SWIG=OFF.
Maybe try working from a clean new build directory.

I will see if I can test this soon on Fedora 20 but I bet this is not OS related.

Michka

Le 5 juin 2014 à 14:34, Rashad M a écrit :

> Hi again,
> 
> I succeeded in building python bindings. First i disabled internal swig ITK_USE_SYSTEM_SWIG=ON
> 
> cd Wrapping/Generators
> make clean
> make
> Copying itk.py to build dir.
> Copying itkBase.py to build dir.
> Copying itkTemplate.py to build dir.
> Copying itkTypes.py to build dir.
> Copying itkExtras.py to build dir.
> Copying itkLazy.py to build dir.
> Built target copy_python_files
> 
> if i do make install from Wrapping/Generators, I got:
> 
> -- Install configuration: "Release"
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/CMakeLists.txt
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/itk.i
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/itkConfig.py
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/WrapITKBuildOptionsPython.py
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/Configuration/WrapITKBuildOptionsConfig.py
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/itk.py
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/itkBase.py
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/itkTemplate.py
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/itkTypes.py
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/itkExtras.py
> -- Installing: /home/rashad/local/lib/ITK-4.6/Python/itkLazy.py
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/CMakeLists.txt
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/ExternalProjectConfig.pth.in
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/ExternalProjectConfig.py.in
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/ModuleConfig.py.in
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/ModuleLoader.py.in
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/WrapITK.pth.in
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/itkConfig.py.in
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/main_module_ext.i.in
> -- Installing: /home/rashad/local/lib/cmake/ITK-4.6/WrapITK/Configuration/Generators/Python/module_ext.i.in
> 
> 
> But if i go to top level directory
> cd ~/build/trunk-itk
> 
> make
> 
> I am getting the error in last message:
> 
> [ 45%] Built target copy_python_files
> [ 45%] Generating pyBasePython.cpp, ../../../../lib/pyBasePython.py
> /bin/sh: /home/rashad/build/trunk-itk/Wrapping/Generators/SwigInterface/swig/bin/swig: No such file or directory
> make[2]: *** [Wrapping/Generators/Python/PyBase/pyBasePython.cpp] Error 127
> make[1]: *** [Wrapping/Generators/Python/PyBase/CMakeFiles/ITKPyBasePython.dir/all] Error 2
> 
> I think this is trying to use internal swig even if ITK_USE_SYSTEM_SWIG=OFF
> 
> 
> 
> 
> 
> 
> 
> On Thu, Jun 5, 2014 at 12:09 PM, Rashad M <mohammedrashadkm at gmail.com> wrote:
> ITK version from git master
> 
> git pull gives: Already up-to-date.
> 
> Platform: Linux Fedora 20 x86_64
> Python: Python 2.7.5 (default, Feb 19 2014, 13:47:28) 
> [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
> 
> System SWIG: 
> SWIG Version 2.0.11
> 
> Compiled with g++ [x86_64-redhat-linux-gnu]
> 
> Configured options: +pcre
> 
> I followed your suggestion and enabled only ITK_WRAP_PYTHON=ON and I am getting the below error during make
> 
> make[2]: *** No rule to make target `/home/rashad/code/itk/ITK/Wrapping/Generators/Python/PyBase/swig', needed by `Wrapping/Generators/Python/PyBase/pyBasePython.cpp'.  Stop.
> make[1]: *** [Wrapping/Generators/Python/PyBase/CMakeFiles/ITKPyBasePython.dir/all] Error 2
> 
> 
> 
> 
> On Thu, Jun 5, 2014 at 11:40 AM, Michka Popoff <michkapopoff at gmail.com> wrote:
> Hi
> 
> I changed to the community mailing list to answer your question, so everybody sees it.
> 
> 
> To build the python wrappings, you juste need the DITK_WRAP_PYTHON=ON option.
> Note: Java, Ruby and TCL can stay OFF, those are not supported for the moment (even if the options are present in cmake).
> I would need more details to be able to help you:
> 
> - Which version of ITK are you trying to build
> - What version of python
> - On what platform (linux, mac, win ?) are you trying this.
> 
> Michka
> 
> Le 5 juin 2014 à 11:01, Rashad M a écrit :
> 
>> Hi,
>> 
>> I tried to build python bindings for ITK and build failed with below output:
>> 
>> canning dependencies of target ITKPyBasePython
>> [ 23%] Building CXX object Wrapping/Generators/Python/PyBase/CMakeFiles/ITKPyBasePython.dir/ITKPyBasePython.cpp.o
>> [ 23%] Building CXX object Wrapping/Generators/Python/PyBase/CMakeFiles/ITKPyBasePython.dir/pyBasePython.cpp.o
>> Linking CXX shared module ../../../../lib/_ITKPyBasePython.so
>> [ 23%] Built target ITKPyBasePython
>> Scanning dependencies of target ITKCommonIdx
>> [ 23%] Generating ../../Typedefs/vcl_complex.idx
>> Traceback (most recent call last):
>>   File "/home/rashad/code/itk/ITK/Wrapping/Generators/SwigInterface/idx.py", line 28, in <module>
>>     res = pygccxml_reader.read_xml_file(sys.argv[1])
>>   File "/home/rashad/code/itk/ITK/Wrapping/Generators/SwigInterface/pygccxml-1.0.0/pygccxml/parser/source_reader.py", line 240, in read_xml_file
>>     ffname = self.__file_full_name(gccxml_created_file)
>>   File "/home/rashad/code/itk/ITK/Wrapping/Generators/SwigInterface/pygccxml-1.0.0/pygccxml/parser/source_reader.py", line 277, in __file_full_name
>>     raise RuntimeError( "pygccxml error: file '%s' does not exist" % file )
>> RuntimeError: pygccxml error: file '/home/rashad/build/itk/ITK_/Wrapping/Typedefs/vcl_complex.idx' does not exist
>> make[2]: *** [Wrapping/Typedefs/vcl_complex.idx] Error 1
>> make[1]: *** [Wrapping/Modules/ITKCommon/CMakeFiles/ITKCommonIdx.dir/all] Error 2
>> make: *** [all] Error 2
>> 
>> 
>> For cmake I had given
>> cmake -DITK_WRAPING=ON -DITK_WRAP_PYTHON=ON -DITK_USE_SYSTEM_SWIG=OFF -DITK_WRAP_SWIGINTERFACE=ON
>> 
>> but ITK_WRAP_ ( GCCXML JAVA, RUBY, TCL ) are also OFF.
>> 
>> 
>> I dont need gccxml and it is off in my cmake configuration but I am getting pygccxml error
>> 
>> Any ideas?
>> 
>> -- 
>> Regards,
>>    Rashad
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/protraining.php
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-developers
>> _______________________________________________
>> Community mailing list
>> Community at itk.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/community
> 
> 
> 
> 
> -- 
> Regards,
>    Rashad
> 
> 
> 
> -- 
> Regards,
>    Rashad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140605/3c032292/attachment-0002.html>


More information about the Community mailing list