[vtk-developers] VTK/Python and Sun new discoveries

David Gobbi dgobbi at irus.rri.ca
Fri May 24 11:50:35 EDT 2002


Too bad we didn't do this a long time ago.  Back in VTK 3.x, there
actually was a vtkpython.so 'master module' that linked in and
initialized all the other VTK/python modules.  It would have been
trivial to make it into an executable instead of just a module.

Prabhu, what are your feelings on having the executable load up
the VTK/python modules?  And what should be done with the users'
own local modules & classes?

 - David


On 24 May 2002, Andy Cedilnik wrote:

> I will commit what I have, then you or whoever can try to get it to load
> libvtkCommon ...
>
> 			Andy
>
> On Fri, 2002-05-24 at 11:18, David Gobbi wrote:
> > I agree that including a vtkpython binary (I much prefer calling
> > it 'vtkpython' rather than 'vtkPython') is a good idea.  It is
> > trivial to do and it solves a lot of problems.  For the SGI I
> > have to re-link the python executable with the C++ compiler
> > to make it work, I'm not terribly surprised that it is the
> > same under Solaris.
>
> > Perhaps the 'vtkpython' executable could also automatically load
> > libvtkCommonPython et al as well?
>
> >
> > And when VTK/python is built, both VTK and python should definitely
> > be built shared.  Otherwise it is guaranteed that the
> > vtkTkRenderWidget will not work, since when static linking is used
> > both VTK and Python will each have their own copy of the Tk code
> > and the Tk/Tcl global variables.
> >
> > There are ways of building VTK/python static, for example by
> > linking the vtkTkRenderWidget.so against the _tkinter.so module
> > that comes with python instead of linking it against libtk.so.
> > But unless someone wants to work through all the details, add them
> > to the cmake files, and maintain them it is better just to tell
> > everyone to build shared.  This is going to be a problem with
> > python and ITK, since there is no 'shared' option with ITK.
> >
> > Prabhu is correct that I am busy right now, I'm reading the list
> > and recompiling VTK every so often to make sure that all my stuff
> > works with the cvs version of VTK, but I probably won't be
> > committing much of anything in the next few months.
> >
> >  - David
> >
> >
> >
> > On 24 May 2002, Andy Cedilnik wrote:
> >
> > > Prabhu,
> > >
> > > I agree with you. I wish we could use python executable for vtk/python
> > > and tclsh (or wish) for vtk/tcl. Unfortunately that will not work on Sun
> > > using Sun's compiler and probably on HP,SGI,.... Please correct me if I
> > > am wrong. The problem is that C++ code does not get initialized
> > > correctly when the binary is compiled using C compiler and not C++ one.
> > >
> > > As a test, please try this code:
> > > from vtk.tk.vtkTkRenderWidget import *
> > > root = Tk()
> > > pane = vtkTkRenderWidget(root)
> > >
> > > This will crash on all platforms where classes do not get initialized
> > > properly. The funny thing is that all VTK python tests will pass. This
> > > however is not the case with gcc, which does not have any problem with
> > > this.
> > >
> > > So, I think we should add vtkPython, which is just a wrapper around the
> > > actual python library and does not include any code at all.
> > >
> > > 				Andy
> > >
> > > On Fri, 2002-05-24 at 10:37, Prabhu Ramachandran wrote:
> > > > Well, I am not sure that this is the right way to go.  Making a new
> > > > binary seems unnecessary.  Also I dont understand clearly what the
> > > > issues are with the current setup and why you need to add a special
> > > > vtkPython binary.  Maybe you could explain it a little more?  I
> > > > understand that if you want specific features like initializing MPI or
> > > > something like that you'd need a special interpreter but doing it just
> > > > for VTK is a no-no IMHO.
> > > >
> > > > I dont know what David has to say.  I guess he is very busy these
> > > > days.
> > > >
> > > >     AC> Note to python developers: Please add some tests to vtk that
> > > >     AC> will use tk render widget.
> > > >
> > > > I'll keep that in mind when I get some time to do the test stuff.  The
> > > > trouble is that I'm not too familiar with how the testing exactly
> > > > works and don't have too much time to check it out either.
> > > >
> > > > prabhu
> > > > _______________________________________________
> > > > vtk-developers mailing list
> > > > vtk-developers at public.kitware.com
> > > > http://public.kitware.com/mailman/listinfo/vtk-developers
> > > >
> > >
> > >
> > > _______________________________________________
> > > vtk-developers mailing list
> > > vtk-developers at public.kitware.com
> > > http://public.kitware.com/mailman/listinfo/vtk-developers
> > >
> >
>
>




More information about the vtk-developers mailing list