[Insight-users] external project: path error in igenerator.py for python wrapitk

David Fuentes fuentesdt at gmail.com
Sun Feb 17 10:49:25 EST 2013


Hi I'm trying to use WrapITK
to build an external project according to the directions posted.

http://www.vtk.org/Wiki/ITK/Release_4/Wrapping/BuildProcess#External_Project

I'm using ITK4.3.1 with gcc4.4. I seem to have some some sort of path error
with igenerator.py ?
All needed mdx files appear to be in my installed $WrapITK_DIR

$WrapITK_DIR/Configuration/Typedefs

But the build is looking in the current external project directory

$CWD/Typedefs

?

I'm not sure how to make the external build use the installed directory,
$WrapITK_DIR/Configuration/Typedefs ?

/opt/apps/EPD/epd-7.3-1-rh5-x86_64/bin/python
/opt/apps/ITK/InsightToolkit-4.3.1-gcc-4.4.7-dbg/lib/cmake/ITK-4.3/WrapITK/Configuration/Generators/SwigInterface/igenerator.py
--mdx
/opt/apps/ITK/InsightToolkit-4.3.1-gcc-4.4.7-dbg/lib/cmake/ITK-4.3/WrapITK/Configuration/Typedefs/ITKCommon.mdx
--swig-include itk.i --mdx
/work/fuentes/github/PythonWrapItkHelloWorld/Typedefs/dummy.mdx
--swig-include itkDummy_ext.i -w1 -w3 -w51 -w52 -w53 -w54 -A protected -A
private --typedef-input /work/fuentes/github/PythonWrapItkHelloWorld/
itkDummySwigInterface.h.in --typedef-output
/work/fuentes/github/PythonWrapItkHelloWorld/Typedefs/itkDummySwigInterface.h
--include itkDummySwigInterface.h
/work/fuentes/github/PythonWrapItkHelloWorld/itkDummy.xml
/work/fuentes/github/PythonWrapItkHelloWorld/Typedefs/itkDummy.i
Traceback (most recent call last):
  File
"/opt/apps/ITK/InsightToolkit-4.3.1-gcc-4.4.7-dbg/lib/cmake/ITK-4.3/WrapITK/Configuration/Generators/SwigInterface/igenerator.py",
line 560, in <module>
    load_mdx(f)
  File
"/opt/apps/ITK/InsightToolkit-4.3.1-gcc-4.4.7-dbg/lib/cmake/ITK-4.3/WrapITK/Configuration/Generators/SwigInterface/igenerator.py",
line 319, in load_mdx
    load_mdx(os.path.dirname(file_name)+os.sep+l.strip())
  File
"/opt/apps/ITK/InsightToolkit-4.3.1-gcc-4.4.7-dbg/lib/cmake/ITK-4.3/WrapITK/Configuration/Generators/SwigInterface/igenerator.py",
line 311, in load_mdx
    f = file( file_name )
IOError: [Errno 2] No such file or directory:
'/work/fuentes/github/PythonWrapItkHelloWorld/Typedefs/ITKCommon.mdx'

I have been using a hack to sync the two Typedefs directories and it will
build.
also, cmake suggest new name of deprecated macros:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5aa4001..5661181 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,8 +5,8 @@ cmake_minimum_required(VERSION 2.8)
 find_package(ITK REQUIRED)
 find_package(WrapITK REQUIRED)

-WRAP_LIBRARY("${PROJECT_NAME}")
-  set(WRAPPER_LIBRARY_DEPENDS Base)
-  AUTO_INCLUDE_MODULES()
-END_WRAP_LIBRARY()
+itk_wrap_module("${PROJECT_NAME}")
+  set(WRAPPER_LIBRARY_DEPENDS ITKCommon)
+  itk_auto_load_submodules()
+itk_end_wrap_module()
diff --git a/itkDummy.wrap b/itkDummy.wrap
index b3f73bc..7892ff5 100644
--- a/itkDummy.wrap
+++ b/itkDummy.wrap
@@ -1,6 +1,6 @@
-WRAP_CLASS(itk::Dummy POINTER)
-   foreach(t ${WRAP_ITK_SCALAR} ${WRAP_ITK_COLOR} ${WRAP_ITK_COMPLEX_REAL})
-     WRAP_TEMPLATE("${ITKM_${t}}" "${ITKT_${t}}")
+itk_wrap_class(itk::Dummy POINTER)
+   foreach(t ${WRAP_ITK_SCALAR} )
+     itk_wrap_template("${ITKM_${t}}" "${ITKT_${t}}")
    endforeach(t)
-END_WRAP_CLASS()
+itk_end_wrap_class()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130217/f962f731/attachment.htm>


More information about the Insight-users mailing list