From Wiki

Jump to: navigation, search

Compiling VTK with MPI Support

Running Cmake

Grab your favorite version of VTK from [1]. 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

ccmake .

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

Go ahead and configure the project again. Now enable MPI with the following setting:

VTK_USE_MPI           ON

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:

MPI_LIBRARY           /usr/local/lib64/shared/libmpich.so

Also, change the maximum number of processors.


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.

Personal tools