[Insight-users] The easy way to wrap.
James Carroll
jim@microbrightfield.com
Tue May 4 13:26:59 EDT 2004
Hi Luis,
I understand the RelWithDebInfo now. (No problem in my case, since I
have a debugging version of the library from building the Python
source.)
I haven't successfully built everything yet though, and may need more
advise. I updated my CVS head, and re-built and got another set of
errors (I didn't save them.) I cleaned out my build binaries directory,
and started over and got the same error. I'm pretty sure I'm running
into trouble because the dashboard is always a half day or so behind
what's actually in CVS.
So I grabbed a copy of the 1.6.0 source and tried compiling everything
again. When I get to step 5 (building the second time, including
CableSwig) It goes for a good hour or so before complaining:
Building wrap_VXLNumericsPythonPython.cxx from
C:\jimc\prj\InsightToolkit-1.6.0\lib\Wrapping\CSwig\VXLNumerics\wrap_VXL
NumericsPythonPython.cxx.rule
SWIG(1): Warning(120): -c command line option is deprecated. Use
-noruntime instead.
swig error : Unrecognized option -bindir
swig error : Unrecognized option
C:/jimc/prj/InsightToolkit-1.6.0/lib/bin/.\Release
Use 'swig -help' for available options.
Error executing c:\windows\system32\cmd.exe.
ALL_BUILD - 2 error(s), 2 warning(s)
(I'm using the CVS Head of CableSwig with 1.6.0 of ITK under Visual C++
6 SP6)
So my questions are:
Is there by any chance a tag in CVS that would point me to a recent
version of ITK where the python wrappings build cleanly?
Does anyone have a set of windows binaries that include Python wrappings
that they would be willing to send my way?
Thanks!
-Jim
-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez@kitware.com]=20
Sent: Friday, April 30, 2004 8:06 PM
To: James Carroll
Cc: Vidina Monagas; Insight-users@itk.org
Subject: Re: [Insight-users] The easy way to wrap.
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_itkCurvatureFlow
TestPython2.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.
>=20
> The build gave a lot of warnings (in step 5) about not being able to
> find wrappers, but the build completed with zero errors.
>=20
> 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
>=20
> anything. I'm not sure I understand the last line of the readme:
> " - Python must be built Release of RelWithDebInfo on windows."
>=20
> Now I'm copying files to my Python lib/site-packages to see if I can
> start using Insight from python. =20
>=20
> (I'm using CVS Head for Insight, VC6.0 SP6, on Windows XP)
>=20
> When I import InsightToolkit, I get the following error:
>=20
>=20
>=20
>>>>import InsightToolkit as itk
>=20
> 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'
>=20
>=20
> Does anyone have an insight for me on Python?
>=20
> Thank you kindly,
> -Jim
>=20
> I've created an itk.pth file, and copied other stuff this way:
>=20
> in python233\lib\site-packages\ file
> itk.pyth
> has contents: =20
> InsightToolkit
> =20
>=20
> in python233\lib\site-packages\InsightToolkit files:
> =20
> 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
> =20
>=20
>=20
> -----Original Message-----
> From: insight-users-admin@itk.org [mailto:insight-users-admin@itk.org]
> On Behalf Of Luis Ibanez
> Sent: Friday, April 30, 2004 10:16 AM
> To: Vidina Monagas
> Cc: Insight-users@itk.org
> Subject: [Insight-users] The easy way to wrap.
>=20
>=20
> Hi Vidina,
>=20
>=20
> Here is the easy way to build ITK:
>=20
> 1) Run CMake
> Disable TESTING,
> Disable EXAMPLES
> Disable WRAPPING
> Enable SHARED libraries
> configure in this way.
>=20
>=20
> 2) Open the Workspace in Visual Studio
> Select ALL_BUILD
> Select build for Release
> Build the project
> It should take 15 minutes
>=20
>=20
> 3) Download CableSwig
> and put it in the Utilities
> Subdirectory of ITK.
> It will look like:
>=20
> Insight/Utilities/CableSwig
>=20
> By doing this, CableSwig will be
> built along with ITK.
>=20
>=20
> 4) Close the ITK workspace,
> Re-run CMake
> Enable Wrapping (for the scripting
> language you are interested on).
> configure this way.
>=20
>=20
> 5) Open the ITK Workspace
> Select ALL_BUILD
> Select build for Release
> build the project
> This time it will take
> about 1.5 hours.
>=20
>=20
> Please let us know if you still find
> any problems,
>=20
>=20
> Thanks
>=20
>=20
>=20
> Luis
>=20
>=20
> ---------------------
> Vidina Monagas wrote:
>=20
>>Should I compile CableSwig before ITK?
>>
>>----- Original Message -----=20
>>From: "Luis Ibanez" <luis.ibanez@kitware.com>
>>To: "Vidina Monagas" <vidina@ctm.ulpgc.es>
>>Cc: <Insight-users@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
>>>
>>>
>=20
>=20
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users@itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>=20
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users@itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>=20
More information about the Insight-users
mailing list