[Insight-users] The easy way to wrap.

Luis Ibanez luis.ibanez at kitware.com
Fri, 30 Apr 2004 20:05:52 -0400


Hi James,


The reason why the python wrapping must be built for
Release or RelWithDebInfo in Windows, is that the
python distribution only has Release libraries, not
Debug libraries. Since code compiled for Debug is
not compatible with code compiled for Release, you
should avoid using Debug for building ITK if you intend
to use Python wrapping.

--

The problem you are facing were shown in the Dashboard
this morning. Please look at the Python build in
terminus.kitware.

http://www.itk.org/Testing/Sites/terminus.kitware/Windows-devenv-Python/20040430-0500-Nightly/Results/__Testing_Code_Algorithms_itkCurvatureFlowTestPython2.html

Brad fixed this problem today, and the current experimentals
on Python are getting green. (e.g. zion.kitware).

So, please update your CVS checkout and build again.

Setting your PYTHONPATH should be enough for being
able to use the wrapping. There is no need to move
the python files to other locations.


Please let us know if you still find any problems.


    Thanks


      Luis



-----------------------
James Carroll wrote:

> Thank you Luis for the instructions on building wrappers.  I think I
> almost have Python working.
> 
> The build gave a lot of warnings (in step 5) about not being able to
> find wrappers, but the build completed with zero errors.
> 
> If I simply add C:\jimc\prj\Insight\lib\Wrapping\CSwig\Python\Release to
> my python-Path (Following the Wrapping\CSwig\Readme), then it can't find
> 
> anything.  I'm not sure I understand the last line of the readme:
> "     - Python must be built Release of RelWithDebInfo on windows."
> 
> Now I'm copying files to my Python lib/site-packages to see if I can
> start using Insight from python.  
> 
> (I'm using CVS Head for Insight, VC6.0 SP6, on Windows XP)
> 
> When I import InsightToolkit, I get the following error:
> 
> 
> 
>>>>import InsightToolkit as itk
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File
> "C:/jimc/prj/Insight/lib/Wrapping/CSwig/Python\Release\InsightToolkit.py
> ", line 1, in ?
>     from itkalgorithms import *
>   File
> "C:/jimc/prj/Insight/lib/Wrapping/CSwig/Python\Release\itkalgorithms.py"
> , line 1, in ?
>     from itkbasicfilters import *
>   File
> "C:/jimc/prj/Insight/lib/Wrapping/CSwig/Python\Release\itkbasicfilters.p
> y ", line 3, in ?
>     from ITKBasicFiltersPython import *
>   File "ITKBasicFiltersPython.py", line 33, in ?
>     from itkAnisotropicDiffusionImageFilter import *
>   File "itkAnisotropicDiffusionImageFilter.py", line 136, in ?
>     class
> itkAnisotropicDiffusionImageFilterSI3SI3(itkExtractImageFilter.itkImageT
> oImageFilterSI3SI3):
> AttributeError: 'module' object has no attribute
> 'itkImageToImageFilterSI3SI3'
> 
> 
> Does anyone have an insight for me on Python?
> 
> Thank you kindly,
> -Jim
> 
> I've created an itk.pth file, and copied other stuff this way:
> 
> in python233\lib\site-packages\  file
>     itk.pyth
> has contents:    
>        InsightToolkit
>     
> 
> in python233\lib\site-packages\InsightToolkit files:
>     
>     InsightToolkit.py
>     InsightToolkit.pyc
>     itkalgorithms.py
>     itkalgorithms.pyc
>     itkbase.py
>     itkbase.pyc
>     itkbasicfilters.py
>     itkbasicfilters.pyc
>     ITKCommon.dll
>     itkcommon.py
>     itkcommon.pyc
>     itkdata.py
>     itkdata.pyc
>     itkio.py
>     itkio.pyc
>     itknumerics.py
>     itknumerics.pyc
>     itktesting.py
>     itktesting.pyc
>     SwigRuntimePython.dll
>     vxlnumerics.py
>     vxlnumerics.pyc
>     _ITKAlgorithmsPython.dll
>     _ITKBasicFiltersBPython.dll
>     _ITKBasicFiltersPython.dll
>     _ITKCommonPython.dll
>     _ITKIOPython.dll
>     _ITKNumericsPython.dll
>     _VXLNumericsPython.dll
>     
> 
> 
> -----Original Message-----
> From: insight-users-admin at itk.org [mailto:insight-users-admin at itk.org]
> On Behalf Of Luis Ibanez
> Sent: Friday, April 30, 2004 10:16 AM
> To: Vidina Monagas
> Cc: Insight-users at itk.org
> Subject: [Insight-users] The easy way to wrap.
> 
> 
> Hi Vidina,
> 
> 
> Here is the easy way to build ITK:
> 
> 1) Run CMake
>     Disable TESTING,
>     Disable EXAMPLES
>     Disable WRAPPING
>     Enable  SHARED libraries
>     configure in this way.
> 
> 
> 2) Open the Workspace in Visual Studio
>     Select ALL_BUILD
>     Select build for Release
>     Build the project
>     It should take 15 minutes
> 
> 
> 3) Download CableSwig
>     and put it in the Utilities
>     Subdirectory of ITK.
>     It will look like:
> 
>     Insight/Utilities/CableSwig
> 
>     By doing this, CableSwig will be
>     built along with ITK.
> 
> 
> 4) Close the ITK workspace,
>     Re-run CMake
>     Enable Wrapping (for the scripting
>     language you are interested on).
>     configure this way.
> 
> 
> 5) Open the ITK Workspace
>     Select ALL_BUILD
>     Select build for Release
>     build the project
>     This time it will take
>     about 1.5 hours.
> 
> 
> Please let us know if you still find
> any problems,
> 
> 
>     Thanks
> 
> 
> 
>       Luis
> 
> 
> ---------------------
> Vidina Monagas wrote:
> 
>>Should I compile CableSwig before ITK?
>>
>>----- Original Message ----- 
>>From: "Luis Ibanez" <luis.ibanez at kitware.com>
>>To: "Vidina Monagas" <vidina at ctm.ulpgc.es>
>>Cc: <Insight-users at itk.org>
>>Sent: Friday, April 30, 2004 12:18 AM
>>Subject: Re: 24 hours is too long :-)
>>
>>
>>
>>
>>>Hi Vidina,
>>>
>>>The compilation should not take 24 hours,   :-)
>>>
>>>There is definitely something wrong.
>>>
>>>The typical ITK build should take 15 minutes,
>>>when you disable Testing and Examples.
>>>
>>>Did you changed any of the CMake default
>>>options when you configured ITK ?
>>
>>
>>
>>>Or did you make any changes to the workspace
>>>file after loading it in Visual Studio ?
>>>
>>>I didn't see anything strange in your
>>>CMakeCache.txt...
>>>
>>>Do you have other versions of VisualStudio
>>>installed in the same machine ?
>>>
>>>Do you trust your VisualStudion installation ?
>>>(that is, have you used for building any
>>>serious-size project ? )
>>>
>>>
>>>I would suggest you to delete the binary
>>>directory where you are attempting this
>>>build, and restart from scratch.
>>>
>>>Please follow the instruction in the tutorials
>>>
>>>   http://www.itk.org/HTML/Tutorials.htm
>>>
>>>Let us know if you still have any problems,
>>>
>>>
>>>  Thanks
>>>
>>>
>>>    Luis
>>>
>>>
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>