[Insight-users] ITK V4.0.0 with Python Wrapping

Mathieu Stumpf mathieu.stumpf at etu.unistra.fr
Fri Feb 10 04:19:26 EST 2012


Le vendredi 10 février 2012 à 09:47 +0100, Gaëtan Lehmann a écrit :
> Le 10 févr. 12 à 08:57, Mathieu Stumpf a écrit :
> 
> > Le jeudi 09 février 2012 à 10:14 +0100, Mathieu Stumpf a écrit :
> >> Le jeudi 09 février 2012 à 09:55 +0100, Gaëtan Lehmann a écrit :
> >>>> Now I tried again with the git version, but the result seems the  
> >>>> same.
> >>>>
> >>>> My env :
> >>>>       export ITKWRAPPEDINSTALLED=/usr/local/lib/cmake/ITK-4.1/
> >>>> WrapITK/
> >>>>       export LD_LIBRARY_PATH=$ITKWRAPPEDINSTALLED:
> >>>> $ITKWRAPPEDINSTALLED/WrapITK/lib:/usr/local/lib/vtk-5.8/
> >>>>       export PYTHONPATH=$ITKWRAPPEDINSTALLED/WrapITK/lib/:
> >>>> $ITKWRAPPEDINSTALLED/WrapITK/Python/
> >>>>
> >>>
> >>> You shouldn't have all those paths. I'm even quite sure they are not
> >>> correct, like
> >>>
> >>>   /usr/local/lib/cmake/ITK-4.1/WrapITK/WrapITK/lib
> >>>
> >>> Note the double WrapITK, and the absence of any lib in /usr/local/ 
> >>> lib/
> >>> cmake/ITK-4.1/
> >>
> >> Right, but I have no idea which paths I should provide. If I knew the
> >> lib's name the wrapper need, I could make a `whereis`/`find`. Do you
> >> know this information ?
> >>
> >>
> >
> > Anyone to help me on this ? If the problem is just the path it would  
> > be
> > great provided that someone would be able to tell me which path give  
> > to
> > my env variables.
> >
> > Joined with this mail is a complete list of files that my ITK builds
> > (stable&git) installed.
> >
> > I hope it provide enough information, so someone can give me the  
> > correct
> > path, and — hopefully – I can go ahead and code.
> 
> 
> Hi Mathieu,
> 
> Using the following two commands should be enough:
> 
>    export PYTHONPATH=/usr/local/lib/ITK-4.1/Python
>    export LD_LIBRARY_PATH=/usr/local/lib
> 
> then
> 
>    python -c "import itk; itk.force_load()"
> 
> should exist without error (maybe still the warning about  
> PySwigIterator, but nothing much.
> 
> Please let us know how it works.

Here it is :
        $ export PYTHONPATH=/usr/local/lib/ITK-4.1/Python
        $ export LD_LIBRARY_PATH=/usr/local/lib
        $ python -c "import itk; itk.force_load()"
        PySwigIterator not found in module ITKPyBase because of exception:
         'module' object has no attribute 'PySwigIterator'
        PySwigIterator not found in module ITKPyBase because of exception:
         'module' object has no attribute 'PySwigIterator'
        
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/usr/local/lib/ITK-4.1/Python/itkExtras/__init__.py", line 101, in force_load
            getattr(itk, k)
          File "/usr/local/lib/ITK-4.1/Python/itkLazy.py", line 44, in __getattribute__
            value = namespace[attr]
        KeyError: 'PySwigIterator'

I'm now trying to reinstall it all, with other swig version.

* cvs installed in /usr/local/WrapITK and /usr/local/WrapITK/bin/cswig
as the executable
* debian packaged version (toggling ITK_USE_SYSTEM_SWIG flag in ccmake
menu)


Configuring it, cmake return the following (which was already the case
with my previous compilation) :
        
         Warning: No template declared for itk::Mesh. Perhaps should you turn on more WRAP_* options?
        
         Warning: No template declared for itk::MeshSource. Perhaps should you turn on more WRAP_*
         options?
        
         Warning: No template declared for itk::ImageToMeshFilter. Perhaps should you turn on more WRAP_*
         options?
        
         Warning: No template declared for itk::MeshToMeshFilter. Perhaps should you turn on more WRAP_*
         options?
        
         Warning: No template declared for itk::BinaryMask3DMeshSource. Perhaps should you turn on more
         WRAP_* options?
        
I tried to turn ON all wrapper flag except languages and doc ones (tcl,
perl, etc.), but I still have this warnings. With ITK_WRAP_GCCXML ON,
compilation will fail. But I'm rather doubt that I need it, so this
isn't important to me.

Using the debian swig version, the following error ISN'T return, but it
is returned with both cvs and ITK provided versions :

         CMake Warning (dev) at /usr/share/cmake-2.8/Modules/ExternalProject.cmake:167 (message):
           unknown ExternalProject_Add keyword: PCRE
         Call Stack (most recent call first):
           /usr/share/cmake-2.8/Modules/ExternalProject.cmake:1131 (_ep_parse_arguments)
           Wrapping/Generators/SwigInterface/CMakeLists.txt:44 (ExternalProject_add)
         This warning is for project developers.  Use -Wno-dev to suppress it.
        
For now I recompile with the debian swig configuration, without gccxml,
I will let you know what it gives.

Kind regards,
Mathieu



More information about the Insight-users mailing list