Please find below generic instructions for the installation of TTK
from sources, under MacOS.
These specific notes describe the installation procedure used by TTK's continuous integration to build, install and test TTK under Github's virtual machines running MacOS 26.
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 and VTK support (although we highly recommend to
activate them).
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 5 (
"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.
0. Disclaimer and troubleshooting
Installing software from source can be challenging (in particular under MacOS).
Since build chains can vary quite drastically from one system to another, the instructions below may require adjustments for your system.
In case of building issues, we recommend to check the following MacOS installation script examples for
ParaView
and
TTK.
We use these scripts on a daily basis for building automatically ParaView and TTK under MacOS, for the automatic tests of TTK's continuous integration.
1. Downloads
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
Several dependencies will need to be installed in order to
compile ParaView and TTK from source. Please enter the following commands
in a terminal to install them using
homebrew
:
brew install --cask xquartz
brew install mesa glew qt@5 ninja libomp
Note that these commands will also trigger the installation of the (numerous)
dependencies of these components.
Optional dependencies
In order to enjoy the complete set of TTK features, we also recommend to
install the following,
optional dependencies, with the following command:
brew install boost cgal eigen graphviz spectra sqlite tbb zlib numpy qhull
3. Preparing the sources
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-v6.1.1.tar.gz ~/ttk/
mv ~/Downloads/ttk-1.4.0.tar.gz ~/ttk/
cd ~/ttk
tar xvzf ParaView-v6.1.1.tar.gz
tar xvzf ttk-1.4.0.tar.gz
You can delete the tarballs after the source trees have been decompressed by
entering the following commands:
rm ParaView-v6.1.1.tar.gz
rm ttk-1.4.0.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-1.4.0/paraview/patch
./patch-paraview-6.1.1.sh ~/ttk/ParaView-v6.1.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-v6.1.1/
mkdir build
cd build
ccmake .. -G Ninja (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 check/edit some CMake flags (you may
have to press 't' to find them):
· Python3_EXECUTABLE should indicate the correct binary path for python by default.
Once the configuration is finished, you may want to enable additional build options (OSPRay, MPI, etc) to your liking (see the
ParaView
build documentation for further details). Note that certain options require the installation of additional dependencies.
Next, trigger the "Generate" action ('g') and close the configuration window when
the generation is completed.
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 may
take a while):
ninja
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.
~/.zshenv) 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-v6.1.1/build/bin/paraview.app/Contents/MacOS/plugins. And, by default, our installation of pvpython will search fo plugins in
~/ttk/ParaView-v6.1.1/build/bin/plugins. Setting
PV_PLUGIN_PATH overrides this so that both can search for TTK in a common location. If this directory does not exist, you may need to create it as well as
/usr/local/scripts.
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-1.4.0/
mkdir ttk_install (for installing standalone apps)
mkdir build
cd build
ccmake .. -G Ninja
The configuration window opens. Press 'c' to configure, and if it
cannot yet find ParaView, we'll fix this with:
· ParaView_DIR=~/ttk/ParaView-v6.1.1/build/
Press 'c' again to configure (you can ignore any warnings). Next, change:
· CMAKE_BUILD_TYPE=Release
(this should be the default)
· CMAKE_INSTALL_PREFIX=~/ttk/ttk-1.4.0/ttk_install
(this is where standalone apps and
other TTK components are installed)
· TTK_INSTALL_PLUGIN_DIR=/usr/local/lib/plugins
(should be the default, this is where ParaView plugins are installed)
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 variable
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.
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:
ninja
c) Installation
Once the build is finished, enter the following command to install your build
of TTK into your ParaView installation:
ninja 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-1.4.0/paraview/patch/data
mkdir -p ~/ttk/ParaView-v6.1.1/build/bin/paraview.app/Contents/share/paraview-5.11/examples
cp * ~/ttk/ParaView-v6.1.1/build/bin/paraview.app/Contents/share/paraview-5.11/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-v6.1.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!