Topology ToolKit


OSX Installation
Notes for installing TTK 0.9.2, using Sierra 10.12.5 and ParaView 5.4.0. These instructions also worked for TTK 0.9.2, mostly, although the build system changed slightly. The key differences from the linux install involve how ParaView is compiled, installing certain dependencies, and setting up some of the paths for OSX. The follow assumes that the target is to compile with OSX clang and uses homebrew for dependencies.

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'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.8.2)
  • qt5 (tested with 5.9.0)
  • python (tested with 2.7.13)
  • vtk (tested with 7.1.1_1)
Using the command:

$ brew install cmake qt5 python vtk

a) Optional Dependencies

Using homebrew, one can install:
  • ffmpeg (tested with 3.3.2)
  • hdf5 (tested with 1.10.1)
  • tbb (tested with 2017_U7) -- 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.3.0.x86_64.dmg from http://www.ospray.org/getting_ospray.html (this installs in /opt/local/lib).
  • Download and unpack embree-2.16.2.x86_64.dmg from https://embree.github.io/downloads.html (this installs in /opt/local/lib).
  • Download and unpack tbb2017_20170604oss_mac.tgz from https://github.com/01org/tbb/releases. After expanding the .tar, you'll copy the .dylib files to /usr/local/lib (overwritting some). 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.

After doing so, you'll likely want to make sure that your commandline knows about ospray/embree, 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.0.tar.gz ~/ttk/
$ mv ~/Downloads/ttk-0.9.2.tar.gz ~/ttk/
$ cd ~/ttk
$ tar xvzf ParaView-v5.4.0.tar.gz
$ tar xvzf ttk-0.9.2.tar.gz

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

$ rm ParaView-v5.4.0.tar.gz
$ rm ttk-0.9.2.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.2/paraview/patch
$ ./patch-paraview-5.4.0.sh ~/ttk/ParaView-v5.4.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.4.0/
$ 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

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

 · CMAKE_BUILD_TYPE=Release
 · TTK_BINARY_INSTALL_DIR=~/ttk/ttk-0.9.2/bin
 · TTK_PLUGIN_INSTALL_DIR=
~/ttk/ParaView-v5.4.0/build/bin/paraview.app/Contents/MacOS/plugins"

 · withOpenMP=OFF

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 TTK_BINARY_INSTALL_DIR. These can be used outside of ParaView, either as command line tools or VTK-based graphical user interfaces. To list them:

$ ls TTK_BINARY_INSTALL_DIR/*Cmd
$ ls TTK_BINARY_INSTALL_DIR/*Gui

Replacing TTK_BINARY_INSTALL_DIR with what we used above.

If you wish to disable the build and installation of certain TTK components, just comment the corresponding lines in the CMakeLists.txt file at the root of the source tree (~/ttk/ttk-0.9.2/CMakeLists.txt in our example) prior to entering the configuration step of TTK's build (section 6.a).

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.2/paraview/patch/data
$ mkdir ~/ttk/ParaView-v5.4.0/build/bin/paraview.app/Contents/data
$ cp * ~/ttk/ParaView-v5.4.0/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.0/build/bin/paraview.app/Contents/MacOS/

$ ./paraview

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