[vtkusers] vtkLocal and python

Glen Lehmann glehmann at imaging.robarts.ca
Thu Apr 8 09:37:46 EDT 2004


Hi John,

Yup, you need to put the .cxx files in CMakeLists.txt but the .h's  
shouldn't be necessary.

To get rid of the build error comment out the "SUBDIRS(Testing") line  
at the bottom of the CMakeLists.txt file.  CMake is looking for a  
CMakeLists.txt in the Testing dir.

Once the build works you can use make install to install everything.

If you want the module to load when you call "from vtkpython import *"  
then you need to do exactly what you did with the __init__.py and  
local.py files (this doesn't happen automatically).

I prefer to add the location of vtkLocal to my environment paths and  
just call "from libvtkLocalPython" import *" but that doesn't work  
vtkLocal needs to be installed system-wide.

To see the gcc commands set:
CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE.

Hope that helps,
Cheers,
Glen



On Apr 8, 2004, at 9:03 AM, John Hunter wrote:

>
> I just built and installed a filter (vtkRemoveCellsFilter) using
> vtkLocal for use with python.  It went OK, but I had to do several
> things manually so I am wondering if I missed the obvious way to do
> it.
>
> Here is what I did:
>
>   * put the *.cxx and *.h file in vtkLocal and edited the
>     CMakeLists.txt file as described in the README.  Ran cmake -i and
>     then make in the vtkLocal dir.
>
>   * The make failed with a link error in the Testing dir but the libs
>     were built (make output below).  I suspect this is why I had to do
>     the rest by hand
>
>   * Copied the bin/libvtk* to /usr/local/lib/vtk/
>
>   * edited python site-packages/vtk_python/vtk/__init__.py to add the
>     'local' kit and then created local.py to import all the symbols
>     from libvtkLocalPython.
>
> I'm guessing all of the last steps would have worked automatically had
> my make not failed.  Any suggestions about what I can do to fix the
> make?
>
> BTW: how do I see the actual gcc commands generated by cmake/make?
>
> Thanks,
> John Hunter
>
>
>
> hunter:~/c/src/VTK-4.4/Examples/Build/vtkLocal> make
> /hunter/jdhunter/c/src/VTK-4.4/Examples/Build/vtkLocal/Testing:  
> building default_target
> cmake.depends is up-to-date
> /hunter/jdhunter/c/src/VTK-4.4/Examples/Build/vtkLocal/Testing/Cxxq:  
> building default_target
> Building executable  
> /hunter/jdhunter/c/src/VTK-4.4/Examples/Build/vtkLocal/bin/ 
> vtkLocalTest...
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to  
> `vtkPolyDataSource::GetOutput()'
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to `typeinfo  
> for vtkPolyDataToPolyDataFilter'
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to `vtable for  
> vtkPolyDataSource'
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to  
> `vtkPolyDataToPolyDataFilter::CollectRevisions(std:: 
> basic_ostream<char, std::char_traits<char> >&)'
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to  
> `vtkPolyDataToPolyDataFilter::SetInput(vtkPolyData*)'
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to  
> `vtkPolyDataToPolyDataFilter::GetInput()'
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to  
> `vtkPolyDataToPolyDataFilter::PrintSelf(std::basic_ostream<char,  
> std::char_traits<char> >&, vtkIndent)'
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to  
> `vtkPolyDataToPolyDataFilter::vtkPolyDataToPolyDataFilter[not-in- 
> charge]()'
> /usr/local/lib/vtk/libvtkLocal.so: undefined reference to  
> `vtkPolyDataSource::ComputeInputUpdateExtents(vtkDataObject*)'
> collect2: ld returned 1 exit status
> make[5]: ***  
> [/hunter/jdhunter/c/src/VTK-4.4/Examples/Build/vtkLocal/bin/ 
> vtkLocalTest] Error 1
> make[4]: *** [default_target] Error 2
> make[3]: *** [default_target_Cxx] Error 2
> make[2]: *** [default_target] Error 2
> make[1]: *** [default_target_Testing] Error 2
> make: *** [default_target] Error 2
> hunter:~/c/src/VTK-4.4/Examples/Build/
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:  
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list