[vtkusers] python wrapping for external function fails on init function

Kate Fissell fissell at pitt.edu
Tue Sep 20 09:43:11 EDT 2016


Hi,

I am running VTK-7.0.0 on an Ubuntu platform using python 2.7.
I have a cmake configuration for python wrapping that worked on 
VTK-6.2.0 and I
am trying to port it to VTK-7.

It builds ok, but when I try to import into python I get the error
ImportError: dynamic module does not define init function 
(initlibvtkhdftIOPython)
(my function is vtkhdftIO).

I believe this is because vtkWrapPythonInit.c no longer has the loop
#if defined(__CYGWIN__) || !defined(_WIN32)
     /* add a "lib" prefix for compatibility with old python scripts */
     if (strcmp(prefix, "lib") != 0)
       {
       prefix = "lib";
       continue;
       }
#endif


My lib is named libvtkhdftIOPython.so, libvtkhdftIOPythonD.so, but it 
contains
initvtkhdftIOPython  (from running strings on the .so).  Under vtk-6.2.0
the so file contained
initvtkhdftIOPython
initlibvtkhdftIOPython

I have tried various things with CMAKE_SHARED_LIBRARY_PREFIX  to either
get cmake to build the initlibvtkhdftIOPython function, or, to take the 
lib prefix off
the .so, but have not succeeded.

Can you tell me how to get the lib prefix correctly coordinated between init
function and lib name  ?

thanks
Kate



More information about the vtkusers mailing list