VTK on OSX with Mayavi (was: Re: [vtkusers] new user attempting install on mac OSX)
Adrian Umpleby
a.umpleby at imperial.ac.uk
Wed Apr 16 18:57:09 EDT 2003
Hi everyone,
> I am attempting an install of VTK with the goal of then installing
> mayavi.
While this subject is around on-list, I thought it would be worth
recounting my own experiences with VTK on OSX.
I've been using Mayavi under OSX for a while now, both under X11 and
Aqua (by starting from the appropriate python installation, I can
actually have both versions running at once, which is quite neat :-)
The X11 version compiles and runs without a problem under XDarwin
(XFree86 4.1 through latest 4.3) and Apple's X11, once I had compiled
and installed tcltk and python (for use with X11, rather than the
'OSX-standard' framework versions). [Except for a weird several minute
'CPU-heavy' problem with Mayavi's VelocityVectors module with hardware
GL, which I suspect is actually a bug in Apple's GL implementation in
OSX10.2 -it only takes a few seconds with software GL, or OSX10.1 - the
problem is also apparent in the 'Aqua' compiled version under OSX10.2.]
However, getting the 'Aqua' version of Mayavi running was a totally
different matter...
I first compiled VTK on OSX nearly a year ago, under OSX 10.1(.3?).
There were numerous issues to get it roughly going, not least of which
was an Aqua Tkinter.
There are still some issues with Tkinter, but they are not serious, and
I've largely worked around the more 'annoying' ones.
However, there are several problems I found when compiling VTK and using
it via Mayavi, so I'll go through those here...
1) Using gcc3.1 (on OSX10.2 -I have 10.2.3 on my Quicksilver G4) appears
to compile VTK fine. But the problems appear when actually trying to
use VTK.
As soon as I try to 'import libvtkCommonPython' in python it hangs.
Using gdb, it appears to be getting into some sort of mutex lock whilst
loading the dylib. I see the same with 'package require vtk' in tcl.
Just running vtk (i.e. simply type 'vtk' in Terminal) also has the same
behaviour (i.e. it hangs, and gdb reports it is stuck in a mutex lock
during dylib loading).
2) Switching to gcc2.95.2 (using 'gcc_select 2' on OSX10.2, or compiling
under OSX10.1 -I have OSX10.1.3 on my TiBook) causes major problems with
undefined symbols. Removing all those '#ifdef __APPLE_CC__' sections in
the VTK code, and the '-init...' option in the Makefiles, gets further,
but there are still many undefined symbols when creating some of the
dylibs (libvtkImaging.dylib being the first). I think they are related
to the c++ name mangling, and occur from vtkImageIterator and
vtkImageProgressIterator. Adding '-undefined suppress' to the
appropriate Makefiles allows VTK compilation to successfully finish.
This is all with VTK 4.2, and it's probably worth noting that I didn't
have any of these issues when I first compiled it for aqua nearly a year
ago under OSX10.1 - that was taken from CVS early July last year. Since
those symbols are effectively still undefined, does this mean there are
some things related to these 'iterators' in my VTK which will fail when
something tries to use them? (Does Mayavi make any use of these at any
point? How can I test this?)
3) Running Mayavi has to be done interactively through the python
command-line - the "open" dialog box does not work. (That's not a VTK
issue, though, so I'll say no more - files can be opened using
"m=mayavi.mayavi()" to get the mayavi window, followed by
"f=m.open_vtk('/path/to/file',0)".)
4) Once a file has opened, Mayavi crashes in
vtkOpenGLRenderer::ClearLights (well, when that calls glLightModeli,
anyway). I guess this is a VTK problem...? Commenting out the gl calls
there allows it to work. Any ideas what's going on here? (Had this
problem back in July, too...)
5) There are numerous issues which I presume are to do with tk (or
python?), such as errors trying to view the pipeline, problems with
titlebar-less windows (such as the streamline controls window, which I
presume is 'cos it's kind of 'modal' under X11 - but having no titlebar
causes problems once the 'staggering' makes it open partly below the
screen level since it can't be moved fully onscreen!), errors trying to
configure integration parameters for streamlines/tubes (the configure
window fails to appear), etc., etc. I expect these are not to do with
VTK at all, but I throw them out in case anyone here has any thoughts...
Does anyone else have experience using VTK from Mayavi with Aqua Tkinter
under OSX?
If you got this far, thanks for your patience!
Adrian
More information about the vtkusers
mailing list