Development environment:

VTK-8.1.1
macOS Catalina 10.15
Python 2.7.10

Configure variables about Qt in CMake GUi fristly. Some details are in the following script file configure.sh.

cmake ./ -G "Unix Makefiles" \
-DVTK_USE_QVTK:BOOL=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DVTK_USE_GUISUPPORT:BOOL=ON \
-DVTK_QT_VERSION=5 \
-DModule_vtkGUISupportQt:BOOL=ON \
-DModule_vtkGUISupportQtOpenGL:BOOL=ON \
-DModule_vtkGUISupportQtSQL:BOOL=ON \
-DModule_vtkGUISupportQtWebkit:BOOL=OFF \
-DModule_vtkRenderingQt:BOOL=ON \
-DModule_vtkViewsQt:BOOL=ON \
-DVTK_WRAP_TCL:BOOL=ON \
-DTK_INTERNAL_PATH:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/tk-private \
-DVTK_WRAP_PYTHON:BOOL=ON \
-DVTK_PYTHON_VERSION=2.7.10 \
-DPYTHON_EXECUTABLE=/usr/bin/python \
-DPYTHON_INCLUDE_DIR=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/python2.7 \
-DQt5_DIR:PATH=/Users/weiyang/Downloads/Qt5.11.2/5.11.2/clang_64/lib/cmake/Qt5

Download TBB from GitHub and build it.
Go to top level dir and make, we will build release library.
For debug library, we can use commands cd src;make debug.
Relevant dirs:

~/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_debug
~/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_release

Then we set vtk smp implementation type as tbb in CMake GUI.

Then go ahead. Some errors shows.

We can find TBBROOT and TBB_LIBRARY_RELEASE in script file /Users/weiyang/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_release/tbbvars.sh, some variables about debug library can be found in /Users/weiyang/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_debug/tbbvars.sh

I prefer to use bash script to make CMake to generate Makefile for VTK, and then make, make install.

cmake ./ -G "Unix Makefiles" \
-DVTK_USE_QVTK:BOOL=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DVTK_USE_GUISUPPORT:BOOL=ON \
-DVTK_QT_VERSION=5 \
-DModule_vtkGUISupportQt:BOOL=ON \
-DModule_vtkGUISupportQtOpenGL:BOOL=ON \
-DModule_vtkGUISupportQtSQL:BOOL=ON \
-DModule_vtkGUISupportQtWebkit:BOOL=OFF \
-DModule_vtkRenderingQt:BOOL=ON \
-DModule_vtkViewsQt:BOOL=ON \
-DVTK_WRAP_TCL:BOOL=ON \
-DTK_INTERNAL_PATH:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/tk-private \
-DVTK_WRAP_PYTHON:BOOL=ON \
-DVTK_PYTHON_VERSION=2.7.10 \
-DPYTHON_EXECUTABLE=/usr/bin/python \
-DPYTHON_INCLUDE_DIR=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/python2.7 \
-DQt5_DIR:PATH=/Users/weiyang/Downloads/Qt5.11.2/5.11.2/clang_64/lib/cmake/Qt5 \
-DVTK_SMP_IMPLEMENTATION_TYPE:STRING=TBB \
-DTBB_INCLUDE_DIR:PATH=/Users/weiyang/Downloads/tbb/include \
-DTBB_LIBRARY_DEBUG:FILEPATH=/Users/weiyang/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_debug/libtbb_debug.dylib \
-DTBB_LIBRARY_RELEASE:FILEPATH=/Users/weiyang/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_release/libtbb.dylib \
-DTBB_MALLOC_INCLUDE_DIR:PATH=/Users/weiyang/Downloads/tbb/include \
-DTBB_MALLOC_LIBRARY_DEBUG:FILEPATH=/Users/weiyang/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_debug/libtbbmalloc_debug.dylib \
-DTBB_MALLOC_LIBRARY_RELEASE:FILEPATH=/Users/weiyang/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_release/libtbbmalloc.dylib \
-DTBB_MALLOC_PROXY_INCLUDE_DIR:PATH=/Users/weiyang/Downloads/tbb/include \
-DTBB_MALLOC_PROXY_LIBRARY_DEBUG:FILEPATH=/Users/weiyang/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_debug/libtbbmalloc_proxy_debug.dylib \
-DTBB_MALLOC_PROXY_LIBRARY_RELEASE:FILEPATH=/Users/weiyang/Downloads/tbb/build/macos_intel64_clang_cc11.0.0_os10.15_release/libtbbmalloc_proxy.dylib
Categories: VTK

1 Comment

Use vtkSMPTools::For To Speed Up Program | | theArcticOcean · 2020年2月11日 at pm3:26

[…] If you didn’t configure VTK SMP implementation type to parallelize way, I hope the article Configure TBB – VTK Environment For Mac can help […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You cannot copy content of this page