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.3 on OSX, using High Sierra 10.13.2 and ParaView 5.4.1. 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.

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.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.4.1'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

Using homebrew, install:
  • cmake (tested with 3.10.0)
  • qt5 (tested with 5.10.0)
  • python (tested with 2.7.14)
  • vtk (tested with 8.0.1_1)
Using the command:

$ brew install cmake qt5 python vtk

a) Optional Dependencies

Using homebrew, one can install:
  • ffmpeg (tested with 3.4.1)
  • hdf5 (tested with 1.10.1_2)
  • tbb (tested with 2018_U1) -- needed for OSPRay
  • mpich (tested with 3.2_3) -- needed for OSPRay's execution
Using the command (or only parts of it): $ brew install ffmpeg hdf5 tbb mpich

And, in addition, one can install OSPRay and it's dependencies using:
  • Download and unpack ospray-1.4.2.x86_64.dmg from http://www.ospray.org/getting_ospray.html (this installs in /opt/local/lib).
  • Download and unpack embree-2.17.1.x86_64.dmg from https://embree.github.io/downloads.html (this installs in /opt/local/lib).
  • Download and unpack tbb2018_20170919oss_mac.tgz from https://github.com/01org/tbb/releases. After expanding the .tar, I created a directory /opt/local/include/tbb and moved the headers there, while I also created a directory /opt/local/lib/tbb and moved the library files there. Why? The homebrew install for tbb doesn't created the *_debug.dylib's. One could also just install TBB entirely from the website and skip the homebrew install, but in theory these versions match

After doing so, 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.

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.4.1.tar.gz ~/ttk/
$ mv ~/Downloads/ttk-0.9.3.tar.gz ~/ttk/
$ cd ~/ttk
$ tar xvzf ParaView-v5.4.1.tar.gz
$ tar xvzf ttk-0.9.3.tar.gz

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

$ rm ParaView-v5.4.1.tar.gz
$ rm ttk-0.9.3.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.3/paraview/patch
$ ./patch-paraview-5.4.1.sh ~/ttk/ParaView-v5.4.1/

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.4.1/
$ mkdir build
$ cd build
$ ccmake .. (on OSX there is no cmake-gui)

Then, press 'c' to configure and we'll edit some CMake flags:

 · CMAKE_BUILD_TYPE=Release
 · PARAVIEW_ENABLE_PYTHON=ON
 · PARAVIEW_INSTALL_DEVELOPMENT_FILES=OFF (this is unused, should be default)
 · PARAVIEW_QT_VERSION=5 (Qt4 is deprecated on homebrew, should be default)
 · VTK_RENDERING_BACKEND=OpenGL2 (should be default)
 · VTK_SMP_IMPLEMENTATION_TYPE=Sequential

You can also enable optional pieces, e.g. ffmpeg. I also had hdf5 installed through homebrew, but I don't think it was necessary to change anything in cmake.

Note, if you've correctly installed OSPRay for OSX, you can use the following:

 · PARAVIEW_USE_OSPRAY=ON
 · VTK_SMP_IMPLEMENTATION_TYPE=TBB

Then, press 'c' to configure (wait a minute) and then press 't' for advanced mode and we'll edit some more CMake flags:

 · PYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Versions/Current/include/python2.7
 · PYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/Current/lib/libpython2.7.dylib

And if you're doing the optional OSPRay build, also set:

 · OSPRAY_INSTALL_DIR=/opt/local/lib

You may also have to set up the paths for the TBB debug *.dylibs stored in /opt/local/lib (TBB_LIBRARY_DEBUG, TBB_LIBRARY_MALLOC_DEBUG, TBB_MALLOC_LIBRARY_DEBUG, and/or TBB_MALLOC_PROXY_LIBRARY_DEBUG), but on my environment it found those automatically.

Press 'c' again, which fills in some more paths, and then press 'c' one more time and things should be ready to press 'g' to generate and exit.

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.4.1/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.3/
$ 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.4.1/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-7.1). Next, change:

 · CMAKE_BUILD_TYPE=Release
 · CMAKE_INSTALL_PREFIX=~/ttk/ttk-0.9.3/ttk_install (this is where standalone apps and other TTK componentns are installed)
 · TTK_PLUGIN_INSTALL_DIR=
~/ttk/ParaView-v5.4.1/build/bin/paraview.app/Contents/MacOS/plugins"
(this is where ParaView plugins are installed)

Note that you can enable building certian 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.). Press 'c' to reconfigure (again takes a few seconds) and then press 'g' to generate.

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_PLUGIN_INSTALL_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.3/paraview/patch/data
$ mkdir ~/ttk/ParaView-v5.4.1/build/bin/paraview.app/Contents/data
$ cp * ~/ttk/ParaView-v5.4.1/build/bin/paraview.app/Contents/data

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.4.1/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!