[vtkusers] vtk without DISPLAY

David Gobbi dgobbi at irus.rri.on.ca
Wed Feb 14 03:46:14 EST 2001


Hi Robert,

I first tried this little trick with tcl/tk 8.0 and it didn't work:

dot.irus{dgobbi}47: tclsh
% load ./vtktcl
this isn't a Tk application

but with the 'catch' in there it appears to load in everything except
the three Tk widgets (vtkTkRenderWidget and friends).  

Thanks for the info.  (Note to anyone who wants to do this: you have
to 'cd' to vtk/tcl, run 'make vtktcl', and then copy vtktcl into 
/usr/local/lib [or wherever libtcl.so is located] or you can just
specify the full path when you load it).

 - David



Yup, this does work with tcl/tk 8.3 (but not with tcl/tk 8.0 apparently).

On Wed, 14 Feb 2001, Robert Belleman wrote:

> David,
> 
> It *is* possible to use tcl in batch jobs. You just need to be careful
> that your script doesn't use anything that requires an X connection.
> That means you can NOT use the "vtk" executable, but you CAN use
> "tclsh" and load the vtk libraries from there.
> 
> For example; something like this works well in a nohup job (verified):
> 
> ----------------------------------------------------------------------
> #!/usr/bin/env tclsh8.3
> 
> catch {load vtktcl}
> 
> vtkSphereSource sphere
>   sphere SetCenter 15 15 15
>   sphere SetRadius 5.5
> 
> vtkImplicitModeller imp
>   imp SetInput [sphere GetOutput]
>   imp SetSampleDimensions 30 30 30
> 
> vtkStructuredPointsWriter dump
>   dump SetInput [imp GetOutput]
>   dump SetFileName "grid.vtk"
>   dump Write
> ----------------------------------------------------------------------
> 
> Best,
> -- Rob
> 
> [] Robert Belleman         X  Section Computational Science            []
> [] robbel at science.uva.nl  |X| University of Amsterdam, the Netherlands []
> [] tel: (+31) 20 525 7510  X  http://www.science.uva.nl/~robbel/       []
> 
> On Tue, Feb 13, 2001 at 04:53:42PM -0500, David Gobbi wrote:
> > Hi Patrick,
> > 
> > I think you have missed the point.  Erik most likely wants to either
> > run batch jobs on a remote machine without requiring an X connection
> > back to his own machine, or he want to be able to nohup the vtk process so
> > that he can log out of his machine without killing the batch job.
> > 
> > As far as I know, neither of these are possible with the tcl vtk 
> > executable because the vtk executable requires an X connection.
> > There are ways to work around this, but I can't think of any
> > trivial ways to do so.
> > 
> >  - David
> > 
> > On Tue, 13 Feb 2001, Patrick Lowry wrote:
> > 
> > > David:
> > > 
> > > It is unclear to me what tcl has to do with evoking vtk without a DISPLAY
> > > device.  I run vtk filters with tcl all the time where I only show a small
> > > top level window that tell me when the process is finished.  No window has
> > > to be shown at all if desired.
> > > 
> > > Patrick Lowry
> > > 
> > > At 03:44 PM 2/13/2001 -0500, you wrote:
> > > >On Tue, 13 Feb 2001, Erik Sobel wrote:
> > > >
> > > >> Is there a command line option to vtk to envoke it without a DISPLAY
> > > device 
> > > >> - for batch filtering etc.
> > > >> 
> > > >> Thanks,
> > > >> Erik
> > > >
> > > >Sure, just don't use tcl.  This is no problem for VTK programs written
> > > >in Python or C++ (and probably also true for Java).
> > > >
> > > > - David
> 

-- 
--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario





More information about the vtkusers mailing list