[vtkusers] VTK & Python - Details

Randall Hand randall.hand at gmail.com
Thu Jul 6 12:43:49 EDT 2006


Ok.. I just got VTK & Python working together on my Windows & our IRIX
system, but I had alot of issues.. Just want to ask here to see if anyone
has any ideas or better solutions.

On Windows:
I compiled VTK's latest CVS and used the Downloaded Binaries of Python
2.4.3from
www.python.org.
1) To get around a persistent "Unknown CMake Command VTK_GET_TCL_TK_VERSION"
error when I enabled VTK_WRAP_PYTHON, I had to disable VTK_USE_TK.
2) Once compilation was complete & installation ran, I was unable to import
the vtk package because various dll's were missing.  I finally had to copy
libvtk*PythonD.dll to vtk*Python.dll and now it works.  the libvtk* versions
are required for the inter-library links, but python wants just the vtk*
versions.

On IRIX. (On Irix, I wanted to compile everything 64-bit for the large
memory/data support)
Using latest VTK CVS (as of this morning) and python 2.4.3 compiled from
source by me.
1) To get Python to compile 64-bit, I not only had to set CFLAGS, CPPFLAGS,
and LDFLAGS to "-64 -mips4", but after I ran configure I had to manually
edit the Makefile and add "-64 -mips4" to the BASECFLAGS line.
2) Once Python was installed, I had to manually edit the Python.h file to
remove (I actually #if 0'd it) the references to time.h since there is a
collision between the declaration of "select" in unistd.h and sys/time.h
that oddly enough lets Python compile but not VTK's Wrappings.
3) I had to again disable VTK_USE_TK.  Not because of the same
GET_TCL_TK_VERSION error, but because the Widgets kept looking for
TclPkgVersion commands and I wasn't using TCL Wrappings.
4) Finally, during the compile of Wrapping/Python/vtkPythonAppInit the
compile would fail because the libpython2.4.a wanted pthreads.  Enabling
PTHREADs in cmake caused other problems, so I finally hand-compiling that
one file (gmake VERBOSE=1 to get the command) and added the "-lpthread" .

For VTK, I used my "usual" compile parameters for 64-bit, Mangled-Mesa, &
Shared libs.


-- 
----------------------------------------
Randall Hand
Visualization Scientist
ERDC MSRC-ITL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060706/6e7ba77d/attachment.htm>


More information about the vtkusers mailing list