Compiling VTK with MPI Support
Grab your favorite version of VTK from . Set the following environment variables before you run Cmake:
# For C Shell setenv CC mpicc setenv CXX mpiCC # For BASH export CC=mpicc export CXX=mpiCC
In addition, you will need to have setup your environment for MPI as discussed as Using MPI.
You are now ready to run Cmake. Navigate to the VTK directory and enter
Run the initial configuration by typing the 'c' key. When you are done, set up VTK with whatever options you like. I have used the default settings, with the following exceptions:
CMAKE_INSTALL_PREFIX /home/cquammen/install VTK_DEBUG_LEAKS ON VTK_USE_PARALLEL ON
Go ahead and configure the project again. Now enable MPI with the following setting:
Cmake sets the MPICH library to the the static version. We'll want to change this to the shared library. Edit the MPI_LIBRARY setting to:
Also, change the maximum number of processors.
MPIEXEC_MAX_NUMPROCS 256 VTK_MPI_MAX_NUMPROCS 256
Configure the project again. Generate the project files by typing the 'g' key. Cmake will exit. You are now ready to build the project.
Building the Project
Type 'make' and head out to get some coffee.