Porting to VTK 5.4.2

This is now deprecated! Please see VTK Upgrade instead.

VisIt currently uses a slightly modified version of VTK 5.0.0. We rarely change the VTK that VisIt builds against because it takes a lot of effort to port, debug, and verify a new VTK works well with VisIt.


We are nearing a point where we should think about an update to VisIt's VTK library for these reasons:

  • VTK has probably fixed a lot of bugs since 5.0
  • VTK has a totally new rendering infrastructure
    • It does the right thing with various data precisions (for example, double coordinates work)
    • It uses bulk data transfer when possible (vertex arrays, etc) that minimize the number of GL calls
    • It puts in place a mechanism for calling OpenGL extensions
    • It puts in place machinery for using GLSL shaders
      • I'd like these so I can write a 3D fullframe mode using vertex programs.
  • (more to come)


This can be a lot of work.

However, from what I've tested so far, I was able to build VTK 5.4.2 (with a little pain) and build it against VisIt with some modest changes to configure,some Makefiles, and the vtkQt library.


I've created a branch with my initial changes. I encourage all VisIt developers to move this along. This can proceed in tandem with other projects but I'm going to shoot for getting the Cross-Platform Build done first.

co_branch PortVTK542 src -user whitlocb

Building VTK

VTK's support for mangled mesa has atrophied, I found that Ithough the classes still exist and there is still support for mangled mesa in the build system. had to update most of the Mesa classes using their OpenGL counterparts. Basically, I copied the OpenGL class definition into the Mesa header file and then replaced OpenGL with Mesa. This got me through most of the problems. On request, I can on make a VTK tar file available with my changes. We can then iterate on fixes to VTK. Any fixes should be contributed back to Kitware this time.

  • Another approach would be for us to abandon mangled mesa and choose our GL library at runtime like we've been starting to do in our own mappers.

After I was able to get VTK to build all the way through, I ran make install to install it. It might be an artifact of how I configured (I tried using VTK_INSTALL_ROOT instead of CMAKE_INSTALL_PREFIX, which is a MISTAKE!) but when VTK installed, it did so differently than we're used to.


  1. VTK created an include/vtk-5.4 directory under which headers were installed.
  2. Most headers were copied to include/vtk-5.4 and not to Common, Rendering, ... and so on directories.
  3. VTK created a lib/vtk-5.4 directory where the libraries were installed.

For now, I just removed the extra level vtk-5.4 to make VisIt's configure changes easier for the exploratory part of this project. Upon real work towards porting, we should use the directory structures that VTK uses when it installs itself using make install.

  • Note: The VTK-5.4.2 tarball has some permissions issues - before building run 'chmod -R +x VTK' to avoid headaches.

Action items More information Status
Create modified tarball I've changed many Mesa classes in a first attempt to get them working again. At least they compile now. I have not created the tarball yet
Investigate "make install" When I did "make install" it changed how VTK is arranged when it gets installed. We should see if this is real or whether I messed up. not done
Build on hoth Build the new VTK and install on hoth not done

Changing VisIt

I was able to do a partial VisIt build against 5.4.2 and have it successfully do some plots. This is encouraging since it suggests that the filtering pieces of VTK's API are not different enough to break the rest of VisIt. So far, I've only had to change windowing and rendering, which is to be expected in light of VTK's many enhancements in those areas.

Action items More information Status
configure Change configure to look for new VTK libraries, update include and library paths I did enough to get VisIt to build but there may be more changes
vtkQt Change vtkQtRenderWindow so it works with the new VTK. I ported enough so that it displays graphics but interactions don't work right now
MFIX The VisIt build ultimately failed in the MFIX reader. This is pretty good for a 1st attempt. We will need to update the MFIX reader to use the new VTK class's interface. not done