Build Settings#

VTK has a number of settings available for its build. The common variables to modify include:

  • BUILD_SHARED_LIBS (default ON): If set, shared libraries will be built. This is usually what is wanted.

  • VTK_USE_PCH (default ON): If set, VTK will use precompiled headers to speed up compilation.

  • VTK_USE_CUDA (default OFF): Whether CUDA support will be available or not.

  • VTK_USE_MPI (default OFF): Whether MPI support will be available or not.

  • VTK_WRAP_PYTHON (default OFF; requires VTK_ENABLE_WRAPPING): Whether Python support will be available or not.

Less common, but variables which may be of interest to some:

  • VTK_BUILD_EXAMPLES (default OFF): If set, VTK’s example code will be added as tests to the VTK test suite.

  • VTK_ENABLE_LOGGING (default ON): If set, enhanced logging will be enabled.

  • VTK_LOGGING_TIME_PRECISION (default 3; requires VTK_ENABLE_LOGGING): Change the precision of times output when VTK_ENABLE_LOGGING is on.

  • VTK_BUILD_TESTING (default OFF): Whether to build tests or not. Valid values are OFF (no testing), WANT (enable tests as possible), and ON (enable all tests; may error out if features otherwise disabled are required by test code).

  • VTK_ENABLE_KITS (default OFF; requires BUILD_SHARED_LIBS): Compile VTK into a smaller set of libraries. Can be useful on platforms where VTK takes a long time to launch due to expensive disk access.

  • VTK_ENABLE_WRAPPING (default ON): Whether any wrapping support will be available or not.

  • VTK_WRAP_JAVA (default OFF; requires VTK_ENABLE_WRAPPING): Whether Java support will be available or not.

  • VTK_JAVA_RELEASE_VERSION (default 8; requires VTK_WRAP_JAVA): The version of Java in which VTK’s Java wrapping will be built for.

  • VTK_WRAP_SERIALIZATION (default OFF; requires VTK_ENABLE_WRAPPING): Whether serialization code will be auto generated or not.

  • VTK_BUILD_MAVEN_PKG (default OFF; requires VTK_WRAP_JAVA): Whether to build the Java Maven package for VTK.

  • VTK_SMP_IMPLEMENTATION_TYPE (default Sequential): Set which SMPTools will be implemented by default. Must be either Sequential, STDThread, OpenMP or TBB. The backend can be changed at runtime if the desired backend has his option VTK_SMP_ENABLE_<backend_name> set to ON.

  • VTK_ENABLE_CATALYST (default OFF): Enable catalyst-dependent modules including the VTK catalyst implementation. Depends on an external Catalyst.

  • VTK_WEBASSEMBLY_64_BIT (default OFF): This option is applicable only when building with Emscripten toolchain. Adds -sMEMORY64 compiler and linker flags.

  • VTK_WEBASSEMBLY_THREADS (default OFF): This option is applicable only when building with Emscripten toolchain. Adds -pthread compiler and linker flags. When VTK_BUILD_TESTING is ON, this also runs unit tests in web workers, which is the only way for the tests to reliably load data files without having to embed entire datasets inside the test binaries.

  • VTK_WEBASSEMBLY_SMP_THREAD_POOL_SIZE (default 0, means runtime hardware concurrency): This option can be used for limiting the number of webassembly threads consumed by SMP tools. By setting this you can reserve threads for your application to use.

  • VTK_TESTING_WASM_ENGINE (default ``): Path to a wasm runtime executable. This is used to run C++ tests in wasm environments.

  • VTK_WRAP_JAVASCRIPT (default OFF; requires VTK_ENABLE_WRAPPING): Whether JavaScript support will be available or not.

  • VTK_WASM_DEBUGINFO (default NONE): Extent of debug information in webassembly binaries when VTK_WRAP_JAVASCRIPT is ON. Controls the debug flags that allow the compiler to collect the debugging information. Must be either NONE, READABLE_JS, PROFILE or DEBUG_NATIVE.

  • VTK_WASM_OPTIMIZATION (default SMALL): Optimization knobs for the webassembly binaries when VTK_WRAP_JAVASCRIPT is ON. Controls the optimization flags being used when running emcc. Must be either NO_OPTIMIZATION, LITTLE, MORE, BEST, SMALL, SMALLEST or SMALLEST_WITH_CLOSURE.

  • VTK_WEBASSEMBLY_JOB_POOL_LINK_SIZE (default number of processors): Size of the job pool for linking wasm targets. Adjust as needed to avoid OOM errors.