Topology ToolKit


OSX Installation
Please find below detailed instructions for the installation of TTK under MacOS.

TTK is also supported on other operating systems:
 ·  Linux installation instructions (default target platform);
 ·  Windows installation instructions.

This page describes installing TTK 0.9.7 on OSX, using High Sierra 10.13.6 and ParaView 5.6.0. The key differences from the linux installation involve how ParaView is compiled, installing certain dependencies, and setting up some of the paths for OSX. The following assumes that the target is to compile with OSX clang and uses homebrew for dependencies, including python3

Other versions of earlier software packages may require slight variations in the installation procedure. For earlier versions of both software packages, you may want to check out previous versions of our installation notes for OSX:
 · TTK 0.9.6 with ParaView 5.5.2.
 · TTK 0.9.5 with ParaView 5.5.0.
 · TTK 0.9.3 (and 0.9.4) with ParaView 5.4.1.
 · TTK 0.9.2 with ParaView 5.4.0.

1. Downloads

Note: The instructions for this step are identical to those on linux:

TTK builds on top of ParaView for its main user interface. Thus, you will first need to download ParaView 5.6.0's source code. Note that TTK plugins for ParaView will only work with a version of ParaView compiled from source. Thus, if you already installed ParaView with a binary copy, you may need to un-install it before proceeding. Next, download TTK from our download page.

2. Installing the dependencies

a) Required Dependencies

Using homebrew, install:
  • cmake (tested with 3.13.0)
  • qt5 (tested with 5.11.2)
  • python (tested with 3.7.1)
    Note: For this installation, we have switched to python3 instead of python2. To map the default executable for python, please add export PATH="/usr/local/opt/python/libexec/bin/:$PATH" to either your ~/.bashrc, ~/.bash_profile, or other shell startup script.
  • vtk (tested with 8.1.2)
    Note: we excluded building python2 with vtk so as to not have to install both python2 and python3. This required installing certain vtk dependencies separately that also excluded python2, including:
    • sip (tested with version 4.19.8)
    • pyqt (tested with version 5.10.1
    Installing vtk will also install hdf5 as a dependency (that ParaView can make use of).
Altogether, this required the following sequence of commands:

$ brew install cmake qt5 python
$ export PATH="/usr/local/opt/python/libexec/bin/:$PATH"
$ brew install sip --without-python@2
$ brew install pyqt --without-python@2
$ brew install vtk --with-python --with-qt --without-python@2

b) Optional Dependencies

(i) ffmpeg:
Using homebrew, one can install optional packages for ParaView features with homebrew:
  • ffmpeg (tested with 4.1)
Using the command: $ brew install ffmpeg

(ii) OpenMP:
Using homebrew, one can also install OpenMP support for ParaView and TTK with homebrew:
  • libomp (tested with 6.0.1)
Using the command: $ brew install libomp

(iii) OSPRay:
And, in addition, one can install OSPRay and it's dependencies using:
  • mpich (tested with 3.2.1_2):
    $ brew install mpich
  • Download and expand ospray-1.7.2.x86_64.macosx.tar.gz from http://www.ospray.org/ getting_ospray.html, to install:
    • Copy lib/cmake and lib/libospray* to /opt/local/lib
    • Copy include/* to /opt/local/include
    • Copy scripts to /opt/local/share/OSPRay-1.7.2
    • Copy bin and doc to /Applications/OSPRay
    You may need to create some of the destination directories before copying. The above steps manually do the work that the *.dmg used to (but, such file is currently missing).
  • Download and unpack embree-3.2.4.x86_64.dmg from https://embree.github.io/ downloads.html (this installs in /opt/local and /Applications/Embree2).
  • Download and unpack tbb2019_20181010oss_mac.tgz from https://github.com/01org/tbb/ releases. After expanding the .tgz, to install:
    • Copy lib/libtbb* to /opt/local/lib
    • Copy cmake/* to /opt/local/lib/cmake/tbb
    • Copy include/tbb to /opt/local/include
    You may need to create some of the destination directories before copying.
After doing all of the above, you'll likely want to make sure that your commandline knows about ospray/embree/tbb, the easy fix for this is to add export DYLD_LIBRARY_PATH="/opt/local/lib" to your ~/.bashrc.

(iv) TTK optional dependencies:
Finally, in order to enjoy the complete set of TTK features, we also recommend installing the following, optional TTK dependencies:
  • graphviz (for graph drawing features, version 2.40.1 or later).
  • scikit-learn for Python3 (for data reduction features, version 0.19.0 or later). You can install this for python3 with pip:
    $ pip install -U scikit-learn
  • sqlite (for cinema query features, version 3.24.0 or later);
  • ZFP (for advanced compression support, version 0.5.4 or later), installed from source.
  • zlib (for further compression support, version 1.2.11 or later)

3. Preparing the sources

Note: The instructions for this step are identical to those on linux:

Move the tarballs to a working directory (for instance called ~/ttk) and decompress them by entering the following commands in a terminal (this assumes that you downloaded the tarballs to the ~/Downloads directory):

$ mkdir ~/ttk
$ mv ~/Downloads/ParaView-v5.6.0.tar.gz ~/ttk/
$ mv ~/Downloads/ttk-0.9.7.tar.gz ~/ttk/
$ cd ~/ttk
$ tar xvzf ParaView-v5.6.0.tar.gz
$ tar xvzf ttk-0.9.7.tar.gz

You can delete the tarballs after the source trees have been decompressed by entering the following commands:

$ rm ParaView-v5.6.0.tar.gz
$ rm ttk-0.9.7.tar.gz

4. Patching the ParaView source tree

Note: The instructions for this step are identical to those on linux:

In order to enjoy the complete set of TTK features, we recommend at this stage to patch the ParaView source tree. This step is optional. To proceed, go to the patch directory and apply it as follows:

$ cd ~/ttk/ttk-0.9.7/paraview/patch
$ ./patch-paraview-5.6.0.sh ~/ttk/ParaView-v5.6.0/

5. Configuring, building and installing ParaView

a) Configuration

To enter the configuration menu of ParaView's build, enter the following commands:

$ cd ~/ttk/ParaView-v5.6.0/
$ mkdir build
$ cd build
$ ccmake .. (on homebrew cmake there is no cmake-gui, although you can install this separately from https://cmake.org/download/)

Then, press 'c' to configure and we'll edit some CMake flags:
 · CMAKE_BUILD_TYPE=Release
 · PARAVIEW_ENABLE_PYTHON=ON
 · VTK_SMP_IMPLEMENTATION_TYPE=Sequential (the default)

You can also enable optional pieces, including:
(i) ffmpeg:
 · PARAVIEW_ENABLE_FFMPEG=ON

(ii) OpenMP as the SMP implementation (support is experimental, but both ParaView and TTK can use it):
 · VTK_SMP_IMPLEMENTATION_TYPE=OpenMP (changed from the default "Sequential")
Note, after hitting 'c' to configure, cmake will now set a number of variables for you, including OpenMP_CXX_FLAGS, OpenMP_CXX_LIBRARY, OpenMP_C_FLAGS, OpenMP_C_LIBRARY

(iii) OSPRay (which requires TBB):
 · PARAVIEW_USE_OSPRAY=ON
 · OSPRAY_INSTALL_DIR=/opt/local/lib (this variable will show up and need to be set after setting PARAVIEW_USE_OSPRAY=ON and hitting 'c' to reconfigure.)

(iv) TBB as the SMP implementation (which isn't necessary, but if you do not want to use OpenMP and you've installed OSPRay, then you have TBB too):
 · VTK_SMP_IMPLEMENTATION_TYPE=TBB (changed from the default "Sequential")
Note, hitting 'c' to configure, cmake will also set VTKm_ENABLE_TBB=ON and should find all include dirs and libraries for TBB in /opt/local if you've installed it correctly.

After specifying the above options, press 'c' to configure (wait a minute) and then press 't' for advanced mode to double check the above paths and/or fill in any flags that did not appear the first time. You may need to press 'c' again, which fills in some more paths. Once cmake is finished configuring, you should finalize everything by pressing 'g' to generate and exit.

If you prefer to just run cmake as opposed to ccmake or cmake-gui, the following summarizes five possible installations:
(i) Basic
$ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DPARAVIEW_ENABLE_PYTHON=ON \
..

(ii) Sequential + ffmpeg
$ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DPARAVIEW_ENABLE_PYTHON=ON \
-DPARAVIEW_ENABLE_FFMPEG=ON \
-DVTK_SMP_IMPLEMENTATION_TYPE=Sequential \
..

(iii) OpenMP + ffmpeg
$ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DPARAVIEW_ENABLE_PYTHON=ON \
-DPARAVIEW_ENABLE_FFMPEG=ON \
-DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP \
..

(iv) OSPRay + TBB + ffmpeg
$ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DPARAVIEW_ENABLE_PYTHON=ON \
-DPARAVIEW_ENABLE_FFMPEG=ON \
-DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
-DPARAVIEW_USE_OSPRAY=ON \
-DOSPRAY_INSTALL_DIR=/opt/local/lib \
..

(v) OSPRay + OpenMP + ffmpeg
$ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DPARAVIEW_ENABLE_PYTHON=ON \
-DPARAVIEW_ENABLE_FFMPEG=ON \
-DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP \
-DPARAVIEW_USE_OSPRAY=ON \
-DOSPRAY_INSTALL_DIR=/opt/local/lib \
..



b) Build

Now you can start the compilation process by entering the following command, where N is the number of available cores on your system (this will take a LONG time):

$ make -jN

c) Installation

Once the build is finished, we recommend that you do not use make install. We will work directly in the build directory for the source tree instead of trying to package up a MacOS .app file in /Applications. We'll need to manually make a directory for this:

$ mkdir ~/ttk/ParaView-v5.6.0/build/bin/paraview.app/Contents/MacOS/plugins

6. Configuring, building and installing TTK

a) Configuration

To enter the configuration menu of TTK's build, enter the following commands:

$ cd ~/ttk/ttk-0.9.7/
$ mkdir ttk_install (for installing standalone apps)
$ mkdir build
$ cd build
$ ccmake ..

The configuration window opens. Press 'c' to configure, and you'll see that it cannot yet find ParaView. First, we'll fix this:

 · ParaView_DIR=~/ttk/ParaView-v5.6.0/build/

Press 'c' again to configure (you can ignore the warnings). Also note that VTK_DIR should automatically be set to the homebrew installation of VTK (/usr/local/lib/cmake/vtk-8.1). Next, change:

 · CMAKE_BUILD_TYPE=Release
 · CMAKE_INSTALL_PREFIX=~/ttk/ttk-0.9.7/ttk_install
       (this is where standalone apps and other TTK components are installed)
 · TTK_INSTALL_PLUGIN_DIR=
~/ttk/ParaView-v5.6.0/build/bin/paraview.app/Contents/MacOS/plugins

       (this is where ParaView plugins are installed)

Note that you can enable building certain portions of TTK at this time as well by switching the flags associated with each (e.g. TTK_BUILD_PARAVIEW_PLUGINS, TTK_BUILD_STANDALONE_APPS, etc.). Finally, if you'd like to try out OpenMP (again, experimental), you would add:
 · TTK_ENABLE_OPENMP=ON
 · OpenMP_CXX_FLAGS="-Xclang -fopenmp -I/usr/local/opt/libomp/include"
 · OpenMP_CXX_LIB_NAMES=omp
 · OpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib

Press 'c' to reconfigure (again takes a few seconds) and then press 'g' to generate.

If you prefer to just run cmake as opposed to ccmake or cmake-gui, the following summarizes the two possible installations:
(i) Basic TTK
$ cmake \
-DParaView_DIR=~/ttk/ParaView-v5.6.0/build/ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=~/ttk/ttk-0.9.7/ttk_install \
-DTTK_INSTALL_PLUGIN_DIR=~/ttk/ParaView-v5.6.0/build/bin/paraview.app/Contents/MacOS/plugins \
..

(ii) TTK + OpenMP
$ cmake \
-DParaView_DIR=~/ttk/ParaView-v5.6.0/build/ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=~/ttk/ttk-0.9.7/ttk_install \
-DTTK_INSTALL_PLUGIN_DIR=~/ttk/ParaView-v5.6.0/build/bin/paraview.app/Contents/MacOS/plugins \
-DTTK_ENABLE_OPENMP=ON \
-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I/usr/local/opt/libomp/include" \
-DOpenMP_CXX_LIB_NAMES=omp \
-DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib \
..



b) Build

Now you can start the compilation process by entering the following command, where N is the number of available cores on your system:

$ make -jN

c) Installation

Once the build is finished, enter the following command to install your build of TTK into your ParaView installation:

$ make install

Note that in addition to copying the TTK plugins to your ParaView installation (TTK_INSTALL_PLUGIN_DIR), the above command also installed a collection of standalone TTK programs to CMAKE_INSTALL_PREFIX. These can be used outside of ParaView, either as command line tools or VTK-based graphical user interfaces. To list them:

$ ls CMAKE_INSTALL_PREFIX/bin/*Cmd
$ ls CMAKE_INSTALL_PREFIX/bin/*Gui

Replacing CMAKE_INSTALL_PREFIX with what we used above.

Finally, to make sure the example data files are included in the right path, you have to manually copy the example data into the ParaView .app as well:

$ cd ~/ttk/ttk-0.9.7/paraview/patch/data
$ mkdir -p ~/ttk/ParaView-v5.6.0/build/bin/paraview.app/Contents/share/paraview-5.6/examples
$ cp * ~/ttk/ParaView-v5.6.0/build/bin/paraview.app/Contents/share/paraview-5.6/examples

7. Checking your TTK installation

If you applied all the above steps successfully (including step 4), you can now open a terminal and type the following command to load your TTK-patched ParaView:

$ cd ~/ttk/ParaView-v5.6.0/build/bin/paraview.app/Contents/MacOS/

$ ./paraview

At this point, everything from the standard installation procedure should be accessible. Congrats!

Now, please visit our tutorial page to watch video tutorials showing how to use TTK with ParaView with concrete examples and how to use it from your own Python or C++ code or how to extend TTK by writing up your own module!