Build Settings#
VTK has a number of settings available for its build. The common variables to modify include:
BUILD_SHARED_LIBS(defaultON): If set, shared libraries will be built. This is usually what is wanted.VTK_USE_PCH(defaultON): If set, VTK will use precompiled headers to speed up compilation.VTK_USE_CUDA(defaultOFF): Whether CUDA support will be available or not.VTK_USE_MPI(defaultOFF): Whether MPI support will be available or not.VTK_WRAP_PYTHON(defaultOFF; requiresVTK_ENABLE_WRAPPING): Whether Python support will be available or not.
Less common, but variables which may be of interest to some:
VTK_BUILD_EXAMPLES(defaultOFF): If set, VTK’s example code will be added as tests to the VTK test suite.VTK_ENABLE_LOGGING(defaultON): If set, enhanced logging will be enabled.VTK_LOGGING_TIME_PRECISION(default3; requiresVTK_ENABLE_LOGGING): Change the precision of times output whenVTK_ENABLE_LOGGINGis on.VTK_BUILD_TESTING(defaultOFF): Whether to build tests or not. Valid values areOFF(no testing),WANT(enable tests as possible), andON(enable all tests; may error out if features otherwise disabled are required by test code).VTK_ENABLE_KITS(defaultOFF; requiresBUILD_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(defaultON): Whether any wrapping support will be available or not.VTK_WRAP_JAVA(defaultOFF; requiresVTK_ENABLE_WRAPPING): Whether Java support will be available or not.VTK_JAVA_RELEASE_VERSION(default8; requiresVTK_WRAP_JAVA): The version of Java in which VTK’s Java wrapping will be built for.VTK_WRAP_SERIALIZATION(defaultOFF; requiresVTK_ENABLE_WRAPPING): Whether serialization code will be auto generated or not.VTK_BUILD_MAVEN_PKG(defaultOFF; requiresVTK_WRAP_JAVA): Whether to build the Java Maven package for VTK.VTK_SMP_IMPLEMENTATION_TYPE(defaultSequential): Set which SMPTools will be implemented by default. Must be eitherSequential,STDThread,OpenMPorTBB. The backend can be changed at runtime if the desired backend has his optionVTK_SMP_ENABLE_<backend_name>set toON.VTK_ENABLE_CATALYST(defaultOFF): Enable catalyst-dependent modules including the VTK catalyst implementation. Depends on an external Catalyst.VTK_WEBASSEMBLY_64_BIT(defaultOFF): This option is applicable only when building with Emscripten toolchain. Adds -sMEMORY64 compiler and linker flags.VTK_WEBASSEMBLY_THREADS(defaultOFF): This option is applicable only when building with Emscripten toolchain. Adds-pthreadcompiler and linker flags. WhenVTK_BUILD_TESTINGisON, 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(default0, 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_WEBASSEMBLY_LEGACY_EXCEPTIONS(defaultON): This option is applicable only when building with Emscripten toolchain. WhenON, VTK is compiled with the legacy Wasm EH proposal, matching emscripten’s historical default (-sWASM_LEGACY_EXCEPTIONS=1). Set toOFFwhen the rest of the link — the consumer application and any other libraries — is built with-sWASM_LEGACY_EXCEPTIONS=0; the resulting binary then uses the standardized exception handling proposal end-to-end. Mixing both proposals causes the browser to reject the module at instantiate with “module uses a mix of legacy and new exception handling instructions”.VTK_TESTING_WASM_ENGINE(default ``): Path to a wasm runtime executable. This is used to run C++ tests in wasm environments.VTK_WRAP_JAVASCRIPT(defaultOFF; requiresVTK_ENABLE_WRAPPING): Whether JavaScript support will be available or not.VTK_WASM_DEBUGINFO(defaultNONE): Extent of debug information in webassembly binaries when VTK_WRAP_JAVASCRIPT isON. Controls the debug flags that allow the compiler to collect the debugging information. Must be eitherNONE,READABLE_JS,PROFILEorDEBUG_NATIVE.VTK_WASM_OPTIMIZATION(defaultSMALL): Optimization knobs for the webassembly binaries when VTK_WRAP_JAVASCRIPT isON. Controls the optimization flags being used when running emcc. Must be eitherNO_OPTIMIZATION,LITTLE,MORE,BEST,SMALL,SMALLESTorSMALLEST_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.