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.

If you are an advanced user and you do not wish to install ParaView (TTK's main user interface), you still have the possibility to install TTK without ParaView support (although we highly recommend to activate it).
In that case, simply download TTK as described in section 1, install the dependencies as detailed in section 2 and finally, directly jump to section 6 ("Configuring, building and installing TTK").
Examples showing how to use TTK libraries from your own VTK code can be found on this page.

If you are an advanced user and you do not even wish to install VTK, you still have the possibility to install TTK without VTK support (although we highly recommend to activate it).
In that case, simply download TTK as described in section 1, install the optional dependencies as detailed in section 2 and finally, directly jump to section 6 ("Configuring, building and installing TTK").
Examples showing how to use TTK libraries from your own C++ code can be found on this page.

Most users will want to activate TTK's ParaView support.

This page describes installing TTK 0.9.7 on OSX, using Mojave 10.14.5 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.7 with ParaView 5.6.0 on OSX High Sierra.
 · 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.14.5)
  • qt (tested with 5.12.3)
  • python (tested with 3.7.3)
    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.2.0)
    This required installing certain vtk dependencies, which do install python2 (so take care), including:
    • pyqt (tested with version 5.10.1_1
    • sip (tested with version 4.19.8_11)
    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 qt python vtk

b) Optional Dependencies

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

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

(iii) OSPRay:
And, in addition, one can install OSPRay and it's dependencies using:
  • open-mpi (tested with 4.0.1_1):
    $ brew install open-mpi
  • Download and expand ospray-1.7.3.x86_64.macosx.tar.gz from http://www.ospray.org/getting_ospray.html (you will find it under Old Releases. Newer versions of ospray are not yet compatible with TTK 0.9.7's CMake structure), 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.3
    • 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, this file is currently missing).
  • Download and unpack embree-3.5.2.x86_64.pkg from https://embree.github.io/downloads.html (this installs in /opt/local and /Applications).
  • Download and unpack tbb2019_20190522oss_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 command line 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) tested with version 2.40.1 on homebrew:
    $ brew install graphviz
  • 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), tested with version 3.28.0 on homebrew:
    $ brew install sqlite
  • ZFP (for advanced compression support, version 0.5.4 or later), installed from source.
  • zlib (for further compression support) tested with version 1.2.11 on homebrew:
    $ brew install zlib

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 (you may have to press 't' to find them):
 · CMAKE_BUILD_TYPE=Release
 · PARAVIEW_ENABLE_PYTHON=ON
 · VTK_PYTHON_VERSION=3
 · 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:
At this time, we do not recommend building ParaView 5.6.0 with OpenMP, even though TTK can take advantage of OpenMP for some of its features. For parallelism in ParaView, please use TBB.
(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 \
-DVTK_PYTHON_VERSION=3 \
..

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

(iii) TBB + ffmpeg + OSPRay
$ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DPARAVIEW_ENABLE_PYTHON=ON \
-DVTK_PYTHON_VERSION=3 \
-DPARAVIEW_ENABLE_FFMPEG=ON \
-DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
-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.

Finally, to enable ParaView and pvpython to find the TTK plugins we will build, we recommend setting the environment variable PV_PLUGIN_PATH to be the location where you choose to install TTK. Note that this is different from past installations where we manually installed TTK in the build directory. Instead, these instructions will assume that you will install TTK's plugins in /usr/local/lib/plugins (the cmake variable TTK_INSTALL_PLUGIN_DIR will be set accordingly in the next step).

To set this environment variable permanently, we recommend editing whatever file you normally configure these in (e.g. ~/.bash_profile) and adding the line:

export PV_PLUGIN_PATH="/usr/local/lib/plugins"

Note that, by default, our installation of ParaView will search for plugins in ~/ttk/ParaView-v5.6.0/build/bin/paraview.app/Contents/MacOS/plugins. And, by default, our installation of pvpython will search fo plugins in ~/ttk/ParaView-v5.6.0/build/bin/plugins. Setting PV_PLUGIN_PATH overrides this so that both can search for TTK in a common location. Users may want to choose to use a different location that /usr/local/lib/plugins, although this path is consistent with where the Linux installation of TTK installs them.

For more information, see https://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Using_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.2). 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=/usr/local/lib/plugins
       (this is where ParaView plugins are installed)
 · PYTHON_NUMPY_INCLUDE_DIR=/usr/local/lib/python3.7/site-packages/numpy/core/include
       (this should be where homebrew's python3 installs numpy, which our CMake script does not yet detect)

If you are an advanced user and you do not wish to activate TTK's ParaView support, set the CMake variable TTK_BUILD_PARAVIEW_PLUGINS to OFF. Examples showing how to use TTK libraries from your own VTK code can be found on this page.
Press 'c' to reconfigure (again takes a few seconds) and then press 'g' to generate.

If you are an advanced user and you do not even wish to activate TTK's VTK support, set the CMake variables TTK_BUILD_STANDALONE_APPS and TTK_BUILD_VTK_WRAPPERS to OFF. Examples showing how to use TTK libraries from your own C++ code can be found on this page.
Press 'c' to reconfigure (again takes a few seconds) and then press 'g' to generate.

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=/usr/local/lib/plugins \
-DPYTHON_NUMPY_INCLUDE_DIR=/usr/local/lib/python3.7/site-packages/numpy/core/include \
..

(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=/usr/local/lib/plugins \
-DPYTHON_NUMPY_INCLUDE_DIR=/usr/local/lib/python3.7/site-packages/numpy/core/include \
-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!