Open GoogleCodeExporter opened 9 years ago
x86-64 system
Original comment by boris.ka...@gmail.com
on 6 Aug 2009 at 9:41
I've got the same problem, but with a different error :
>>> import itk
>>> image_type = itk.Image[itk.US,3]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/InsightToolkit/WrapITK/Python/itkLazy.py", line 18, in __getattribute__
itkBase.LoadModule(module, namespace)
File "/usr/lib/InsightToolkit/WrapITK/Python/itkBase.py", line 77, in LoadModule
LoadModule(dep, namespace)
File "/usr/lib/InsightToolkit/WrapITK/Python/itkBase.py", line 77, in LoadModule
LoadModule(dep, namespace)
File "/usr/lib/InsightToolkit/WrapITK/Python/itkBase.py", line 85, in LoadModule
if not swigModuleName in sys.modules: module = loader.load(swigModuleName)
File "/usr/lib/InsightToolkit/WrapITK/Python/itkBase.py", line 196, in load
return imp.load_module(name, fp, pathname, description)
File "/usr/lib/InsightToolkit/WrapITK/lib/ITKPyBasePython.py", line 76, in <module>
from pyBasePython import *
File "/usr/lib/InsightToolkit/WrapITK/lib/pyBasePython.py", line 22, in <module>
_pyBasePython = swig_import_helper()
File "/usr/lib/InsightToolkit/WrapITK/lib/pyBasePython.py", line 20, in
swig_import_helper
if fp is not None: fp.close()
UnboundLocalError: local variable 'fp' referenced before assignment
When looking at the pyBasePython.py file, it appears that the binaries have been
built with Swig 1.3.38. As Ubuntu 9.04 uses Python 2.6, we are hit by the issue
mentionned in the wiki page for release 0.3.0.
If I had access to the script that generated the packages, I'd be more than
willing
to rebuild them using swig 1.3.36, shipped with Ubuntu 9.04.
Original comment by l...@unistra.fr
on 10 Aug 2009 at 9:53
I have got the exact same problem as l...@unistra.fr. Did you managed to get
the script and made the rebuild?
Original comment by xmole...@gmail.com
on 7 Dec 2010 at 5:03
I used the following work-around for this issue :
1. Build WrapITK, using its CMake script, and setting
CMAKE_INSTALL_PREFIX=/usr. Other interesting settings for Python wrappers
include WRAP_ITK_DOC and INSTALL_WRAP_ITK_COMPATIBILITY. The following steps
assume you're located in the build directory.
2. Install it locally :
mkdir -p local_install/usr
sed -e "s/^FILE/#FILE/" -i install_wrapitk_compatibility.cmake
cmake -D CMAKE_INSTALL_PREFIX=local_install/usr -P cmake_install.cmake
sed -e "s/^#FILE/FILE/" -i install_wrapitk_compatibility.cmake
3. Copy the "InstallOnly" files :
mkdir -p local_install/usr/lib/python2.6/dist-packages
mkdir -p local_install/usr/share/cmake-2.6/Modules
cp Languages/Python/InstallOnly/WrapITK.pth
local_install/usr/lib/python2.6/dist-packages
cp InstallOnly/FindWrapITK.cmake local_install/usr/share/cmake-2.6/Modules
4. Debianize the build (adapt the Architecture and Maintainer fields) :
mkdir -p local_install/DEBIAN
cat <<EOF > local_install/DEBIAN/control
Package: wrapitk
Version: 0.3.0
Section: libs
Priority: extra
Architecture: i386
Maintainer: John Doe <jdoe@example.com>
Description: Automated dynamic language binding for Insight Toolkit (ITK)
WrapITK is an effort to automate the language binding process of one of
the largest highly template-oriented c++ libraries, the Insight Toolkit
image processing library.
.
Currently Python, Java and Tcl language bindings are implemented, but
only Python is fully supported. For ITK .NET languages wrapper you may
refer to ManagedITK.
EOF
5. Create the package :
fakeroot dpkg-deb -b local_install ./wrapitk-0.3.0.deb
This has been successfuly tested on several versions of Ubuntu (9.04, 9.10 and
10.04, both x86 and amd64 architectures).
Note that in step 3, the Python and CMake paths should be adapted for the
versions of the platform you're targetting. For Python `python -c "import sys;
print sys.version[:3]"` automates the trick.
Original comment by l...@unistra.fr
on 7 Dec 2010 at 5:32
I am trying to execute the build procedure described in comment #4, but upon
invoking
cmake -D CMAKE_INSTALL_PREFIX=local_install/usr -P cmake_install.cmake
I get
/lib/InsightToolkit/WrapITK/Configuration/Languages/GccXML/wrap_.cxx.in
CMake Error at Libraries/VXLNumerics/cmake_install.cmake:36 (FILE):
file INSTALL cannot find
"/home/bens/schoolwork/phd/labfus/WrapITK/wrapitk-0.3.0/Typedefs/wrap_vcl_complex.idx".
Call Stack (most recent call first):
Libraries/cmake_install.cmake:37 (INCLUDE)
cmake_install.cmake:56 (INCLUDE)
This is correct; Typedefs/ contains .i, .includes, and .mdx files, but no .idx
files.
Therefore, the build process does not work for me, so I cannot use my WrapITK
code on Ubuntu 10.04.
Original comment by Benjamin...@gmail.com
on 8 Dec 2010 at 7:57
I've re-built WrapITK from scratch using the build process I've described in
comment #4, this time using cmake instead of ccmake. I used the following
command line :
cmake -D BUILD_TESTING=OFF -D CMAKE_BUILD_TYPE=Release -D
CMAKE_INSTALL_PREFIX=/usr -D WRAP_ITK_DOC=ON -D WRAP_ITK_PYTHON=ON -D
INSTALL_WRAP_ITK_COMPATIBILITY=ON -D WRAP_float=ON -D WRAP_signed_char=ON -D
WRAP_signed_long=ON -D WRAP_signed_short=ON -D WRAP_unsigned_char=ON -D
WRAP_unsigned_long=ON -D WRAP_unsigned_short=ON ../wrapitk-0.3.0
Is the cableswig package (containing cableidx, responsible for the building of
.idx files) installed on your computer ?
Original comment by l...@unistra.fr
on 10 Dec 2010 at 2:36
Original issue reported on code.google.com by
boris.ka...@gmail.com
on 6 Aug 2009 at 9:40