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

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

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).

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:

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):

(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:

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:

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:

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:

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!