[vtkusers] MingW compilation and Python
Daniel Barbeau
daniel.barbeau at sophia.inria.fr
Mon Oct 22 09:38:33 EDT 2007
Hello,
I'm a new user of VTK, and I needed to build it with python bindings.
The compilation went ok, however there are a few things that should be
taking in consideration to make the 5.0.3 source code work with python
(2.5.1). Here are my notes, maybe you're already aware of these issues,
but anyway, better twice than never no?
When compiling with Mingw (using CMake to generate the makefiles), the
dll files get the "lib" prefix added to their names. This makes it
impossible for python to initialise the modules. In fact, it searches
for the initlibvtkCommonPython() function in the libs, and obviously, it
won't find it. Only initvtkCommonPython() exists.
Furthermore, python 2.5.1 doesn't search for modules as *.dll files
anymore but as *.pyd files.
Finally, not all files are copied to the installation directory with
"mingw32-make install". The missing files are the dlls ending by Python.dll.
What needs to be done is: rename all the dlls named "lib.*Python.dll" to
".*Python.pyd" and then copy them to the installation directory.
After these steps, the "import vtk" command works!
I hope this is useful,
cheers!
Daniel
More information about the vtkusers
mailing list