[Insight-users] Compiling ITKv4.2.1 with support for Pythonv2.7.3 using Visual Studio 2008 win32

Willi Huber surfersparadise85-itk at yahoo.com
Sun Nov 11 09:34:19 EST 2012


Resolved the problem.
Lib vtkPythonCore was missing. Fixed in patch http://review.source.kitware.com/#/c/8460/

Cheers,
Willi


>________________________________
> Von: Willi Huber <surfersparadise85-itk at yahoo.com>
>An: Matt McCormick <matt.mccormick at kitware.com> 
>CC: "insight-users at itk org" <insight-users at itk.org> 
>Gesendet: 2:39 Samstag, 10.November 2012
>Betreff: Re: [Insight-users] Compiling ITKv4.2.1 with support for Pythonv2.7.3 using Visual Studio 2008 win32
> 
>
>Hi Matt,
>
>
>thanks for your help.
>This helped a lot. I did further improvement and will commit my changes I made today or tomorrow.
>Now I got stuck here:
>
>
>4>------ Erstellen gestartet: Projekt: ITKVtkGluePython, Konfiguration: Release Win32 ------
>4>Generating itkVTKImageToImageFilterPython.cpp, ../../../lib/itkVTKImageToImageFilterPython.py
>4>Generating itkImageToVTKImageFilterPython.cpp, ../../../lib/itkImageToVTKImageFilterPython.py
>4>Generating ITKVtkGluePython.cpp, ../../../lib/ITKVtkGluePython.py
>4>Kompilieren...
>4>itkVTKImageToImageFilterPython.cpp
>4>itkImageToVTKImageFilterPython.cpp
>4>ITKVtkGluePython.cpp
>4>Code wird generiert...
>4>Verknüpfen...
>4>   Bibliothek "C:\itkbin\lib\Release\ITKVtkGluePython.lib" und Objekt "C:\itkbin\lib\Release\ITKVtkGluePython.exp" werden erstellt.
>4>itkImageToVTKImageFilterPython.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: static struct _object * __cdecl vtkPythonUtil::GetObjectFromPointer(class vtkObjectBase *)" (__imp_?GetObjectFromPointer at vtkPythonUtil@@SAPAU_object@@PAVvtkObjectBase@@@Z)" in Funktion "__wrap_itkImageToVTKImageFilterID2_GetOutput".
>4>itkVTKImageToImageFilterPython.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: static struct _object * __cdecl vtkPythonUtil::GetObjectFromPointer(class vtkObjectBase *)" (__imp_?GetObjectFromPointer at vtkPythonUtil@@SAPAU_object@@PAVvtkObjectBase@@@Z)".
>4>itkVTKImageToImageFilterPython.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: static class vtkObjectBase * __cdecl vtkPythonUtil::GetPointerFromObject(struct _object *,char const *)" (__imp_?GetPointerFromObject at vtkPythonUtil@@SAPAVvtkObjectBase@@PAU_object@@PBD at Z)" in Funktion "__wrap_itkVTKImageToImageFilterID2_SetInput".
>4>C:\itkbin\lib\Release\_ITKVtkGluePython.pyd : fatal error LNK1120: 2 nicht aufgelöste externe Verweise.
>4>Das Buildprotokoll wurde unter "file://c:\itkbin\Wrapping\Modules\ITKVtkGlue\ITKVtkGluePython.dir\Release\BuildLog.htm" gespeichert.
>4>ITKVtkGluePython - 4 Fehler, 0 Warnung(en)
>
>
>Since disabling VtkGlue isn't an option I would appreciate any help.
>
>
>Thanks in advance,
>Willi
>
>
>
>>________________________________
>> Von: Matt McCormick <matt.mccormick at kitware.com>
>>An: surfersparadise85-itk at yahoo.com 
>>CC: "insight-users at itk org" <insight-users at itk.org> 
>>Gesendet: 16:14 Dienstag, 30.Oktober 2012
>>Betreff: Re: [Insight-users] Compiling ITKv4.2.1 with support for Pythonv2.7.3 using Visual Studio 2008 win32
>> 
>>
>>Hi Willi,
>>
>>
>>some time ago I tried to compile ITK with the Support for Python using Visual Studio 2010 with Win64. I wanted to support 2,3,4 and 5 dimensions and all available datatypes. I committed some patches to get rid of some errors I've found.
>>>That time I ran into a lot of issues and discontinued.
>>> 
>>
>>With your efforts and the efforts of some other community members, the Python wrapping on Windows is steadily improving.  Note that it might still be some time before we will be able to do Visual Studio 2010, but VS2008 and MinGW are much improved.  We now have a contributed VS2008 nightly dashboard build, which helps considerably.
>> 
>>
>>Now I started again compiling and wanted to use VS2008 with only win32. Again I added 4 and 5 dimensions to the standard 2 and 3 and I switched on all the available datatypes for Python support. 
>>
>>Switching on all the available datatypes is good for testing, but it does come with compilation time and library size overhead.
>>
>>We have a patch for 4 dimensions on Windows here:
>>
>>  http://review.source.kitware.com/#/c/8161/
>> 
>>This time I got the following compiler or linker error:
>>>
>>>itkZeroFluxNeumannPadImageFilterPython.cpp
>>>itkWrapPadImageFilterPython.cpp
>>>itkWarpImageFilterPython.cpp
>>>itkVectorResampleImageFilterPython.cpp
>>>itkTileImageFilterPython.cpp
>>>itkSliceBySliceImageFilterPython.cpp
>>>itkShrinkImageFilterPython.cpp
>>>itkResampleImageFilterPython.cpp
>>>itkRegionOfInterestImageFilterPython.cpp
>>>itkPermuteAxesImageFilterPython.cpp
>>>itkPasteImageFilterPython.cpp
>>>itkOrientImageFilterPython.cpp
>>>itkMirrorPadImageFilterPython.cpp
>>>itkInterpolateImageFilterPython.cpp
>>>itkFlipImageFilterPython.cpp
>>>itkExpandImageFilterPython.cpp
>>>itkCyclicShiftImageFilterPython.cpp
>>>itkCropImageFilterPython.cpp
>>>itkBSplineUpsampleImageFilterPython.cpp
>>>itkBSplineDownsampleImageFilterPython.cpp
>>>Code wird generiert...
>>>c:\itksrc\modules\core\common\include\itkimage.h(284) : fatal error C1128: Die Anzahl von Abschnitten hat das Formatierungslimit der Objektdatei überschritten: Kompilieren mit /bigobj.
>>> Ergebnisse     Das Buildprotokoll wurde unter "file://c:\itkbin\Wrapping\Modules\ITKImageGrid\ITKImageGridPython.dir\Release\BuildLog.htm" gespeichert.
>>>ITKImageGridPython - 1 Fehler, 0 Warnung(en)
>>>
>>>I did the compilation of this example by hand with /bigobj as extra flag and voila it worked. 
>>
>>Excellent!  Good find.
>> 
>>
>>Then I wanted to add the /bigobj flag to my CMake configuration so that it automatically is included and I can commit a patch for review.
>>>In CMake/ITKSetStandardCompilerFlags.cmake I 've found a option that already made use of /bigobj whenever VS2005 is used or Win64 is enabled.
>>>Since /bigobj is allowed after VS2005 I changed:
>>>
>>>if(CMAKE_CL_64 OR CMAKE_COMPILER_2005)
>>>set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} /bigobj")
>>>endif()
>>>
>>>to: 
>>>
>>>         if(MSVC_VERSION GREATER 1400 OR MSVC_VERSION EQUAL 1400)
>>>           set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} /bigobj")
>>>         endif()
>>>
>>>which might not be 100 percent correct but at least it does what I want it to do what I've checked with:
>>>message("Flags are ${ITK_REQUIRED_CXX_FLAGS}")
>>>
>>>which shows me:
>>>
>>>Flags are /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR -W3 /bigobj
>>>
>>>I assume the -W3 to be wrong and commented the generating line.
>>>My problem is now that its not appearing in the final results of CMAKE_CXX_FLAGS although it is in the variable at the end of CMakeLists.txt in C:\itksrc which I checked with a message.
>>> 
>>
>>This may or may not be a problem.
>>
>>To check on what flags are actually being passed to the compiler with my VS2008 Express Edition, I go to Tools -> Options -> Projects And Solutions -> Build and Run -> MSBuild project build output verbosity.
>>
>>Looking forward to the patch!
>>
>>Thanks,
>>Matt
>> 
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121111/959a9d74/attachment.htm>


More information about the Insight-users mailing list