[vtk-developers] ruby patch to vtk-5.0.0

David Gobbi dgobbi at atamai.com
Tue Mar 14 09:17:53 EST 2006


Hi Seiya,

Thanks!  I tried the Tk support and it works for me.  The vtkruby executable
works for me, too.

But I try to use vtkruby to run the vtkTkRenderWidget example, it just
returns without displaying anything, and it doesn't print out any error.

When I run vtkTkRenderWidget.rb with ruby, it works fine until I exit,
and then it prints this (under Linux):

===
Generic Warning: In /home/dgobbi/Atamai/VTKruby/Rendering/vtkTkRenderWidget.cxx, line 641
A TkRenderWidget is being destroyed before it associated vtkRenderWindow is destroyed.This is very
bad and usually due to the order in which objects are being destroyed.Always destroy the
vtkRenderWindow before destroying the user interface components.
===

This indicates a garbage collection problem.  What kind of garbage collection does
Ruby use?  To get rid of this error, it is necessary that just before the program
exits, it must remove all references to the vtkRenderWindow and then it must run
the garbage collector, to make sure that the vtkRenderWindow is deleted before the
RenderWidget.

 - David

--- Seiya Nishizawa <seiya at kugi.kyoto-u.ac.jp> wrote:

> Hi David,
> 
> I changed some stuff, then you can run ruby examples without "make install".
> I makd 'vtkruby' like 'vtkpython'.
> It add paths of "LIBRARY_OUTPUT_PATH" and "VTK_BINARY_DIR@/Wrapping/Ruby"
> to ruby's $LOAD_PATH.
> 
> Additionally,
> I added Tk widget support.
> 
> Again,
> the resouces are at
> http://www.gfd-dennou.org/arch/ruby/products/ruby-vtk/index.html
> 
> 
> Cheers
> Seiya
> 
> 
> On Mon, 13 Mar 2006 00:34:13 -0500
> David Gobbi <dgobbi at atamai.com> wrote:
> 
> > Thanks for the information about installation.  Actually I have too many 
> > versions of VTK on
> > my computer to do a "make install" of any one of them.  That is why I 
> > did a manual "ruby setup.rb".
> > 
> > Afterwards, I copied all of the vtk .rb files from 
> > /usr/lib/site_ruby/1.8/ to ~/VTKbin/Wrapping/Ruby
> > and set RUBYLIB to ~/VTKbin/Wrapping/Ruby:~/VTKbin/bin.
> > 
> > It would be good if "cmake" creates all the .rb files that you need in
> > ${VTK_BINARY_DIR}/Wrapping/Ruby so that it would be possible to run the 
> > ruby examples
> > without doing a "make install" first.  In fact,  this will be necessary 
> > in order for VTK "make test"
> > to work properly with ruby, because testing has to work before install.  
> > Or am I missing something?
> > [...]
> > >> To install on my Linux system I did the following, is this what you would recommend?
> > >> 1) grabbed VTK-5-0 from CVS
> > >> 2) cd VTK
> > >> 3) patch -p1 < vtk-ruby-060306.patch
> > >> 4) built VTK with cmake/make
> > >> 5) cd Wrapping/Ruby
> > >> 6) ruby setup.rb (as root)
> > >> 7) installed the "narray-0.5.8" extension for ruby
> > >> 8) set LD_LIBRARY_PATH to find the VTK "bin" directory
> > >>     
> > > After built by make (4),
> > > you can install them to your system by typing
> > > "%make install",
> > > which install vtk files to proper path under CMAKE_INSTALL_PREFIX
> > > and ruby files to ruby_site path (default).
> > > If you specified
> > > VTK_RUBY_LIB_DIR, VTK_RUBY_ARCH_DIR, and VTK_RUBY_SETUP_ARGS(--prefix="/hoge"),
> > > *.rb files are installed to /hoge/VTK_RUBY_LIB_DIR,
> > > and *.so files are to /hoge/VTK_RUBY_ARCH_DIR.
> > [...]
> 
> 
> --------------
> Seiya Nishizawa
> seiya at kugi.kyoto-u.ac.jp
> GnuPG Fingerprint = 0696 D312 5737 929A B481 FC91 44F4 6BA0 467A 7703
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
> 






More information about the vtk-developers mailing list