196.3. vtk-9.5.2
The Visualization Toolkit: meshes, filters and OpenGL rendering, with Python bindings
| Version | 9.5.2, release 2 |
| Shelf | 3d — 3D modelling, animation, voxel and mesh tools and libraries, and scientific visualisation |
| Phase | 42_graphics (Graphics Stack), 19 of 189 in build order |
| Licence | BSD-3-Clause |
| Homepage | https://vtk.org/ |
| Build time | 85.4 SBU |
| Installed size | 287.6 MiB in 4544 files |
| Recipe | ports/core/3d/vtk/kpkgbuild |
About
VTK, the Visualization Toolkit, is a C++ library of data structures, filters and OpenGL rendering for meshes, volumes and scientific data, with Python bindings. In KDOS it is there for FreeCAD: FreeCAD’s FEM workbench post-processes its results through VTK, and its post-processing filters are VTK Python objects, so the Python wrapping is built. External libraries are this tree’s ports wherever VTK can use one, and its own bundled copy otherwise.
Sources
vtk-9.5.2.tar.gz(47.9 MiB)
sha256cee64b98d270ff7302daf1ef13458dff5d5ac1ecb45d47723835f7f7d562c989
upstream: https://www.vtk.org/files/release/9.5/VTK-9.5.2.tar.gz
archive copy: sources-1/3d--vtk-9.5.2.tar.gz
Dependencies
Depends on: cmake, ninja, python3, mesa, libglvnd, libX11, libXcursor, zlib, expat, libxml2, double-conversion, eigen, freetype2, libjpeg-turbo, libpng, libtiff, jsoncpp, lz4, xz, netcdf-c, nlohmann-json, libogg, libtheora, proj, pugixml, sqlite.
Required by (1): freecad.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-DVTK_OPENGL_USE_GLES=OFF, line 30: mesa (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
fix-findexpat.patch— From Debian bug 1050506, which itsPatch-Source:header names. It addsNO_CACHEto thefind_pathandfind_librarycalls in VTK’s ownCMake/FindEXPAT.cmake. CMake’s FindEXPAT keepsEXPAT_LIBRARYas an ordinary variable, and VTK’s copy writing the same names into the cache conflicts with it: a project that finds expat before VTK stops withCould NOT find EXPAT (missing: EXPAT_LIBRARY). Uncached, VTK’s lookups set ordinary variables too.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install vtk'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/3d/vtk.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/3d/vtk
echo 'cee64b98d270ff7302daf1ef13458dff5d5ac1ecb45d47723835f7f7d562c989 vtk-9.5.2.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/vtk
SRC=$SRC_ROOT/vtk-9.5.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf vtk-9.5.2.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/fix-findexpat.patch"
export CXXFLAGS="$CXXFLAGS -DLOGURU_STACKTRACES=0"
mkdir -p build && cd build
cmake .. -G Ninja -Wno-dev -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
-DBUILD_SHARED_LIBS=ON \
-DVTK_BUILD_TESTING=OFF \
-DVTK_BUILD_EXAMPLES=OFF \
-DVTK_BUILD_DOCUMENTATION=OFF \
-DVTK_USE_LARGE_DATA=OFF \
-DVTK_USE_MPI=OFF \
-DVTK_USE_CUDA=OFF \
-DVTK_USE_X=ON \
-DVTK_OPENGL_HAS_EGL=ON \
-DVTK_OPENGL_USE_GLES=OFF \
-DVTK_WRAP_PYTHON=ON \
-DVTK_WRAP_JAVA=OFF \
-DPython3_EXECUTABLE=/usr/bin/python3 \
-DVTK_GROUP_ENABLE_Qt=NO \
-DVTK_GROUP_ENABLE_MPI=NO \
-DVTK_MODULE_ENABLE_VTK_IOFFMPEG=NO \
-DVTK_MODULE_ENABLE_VTK_IOOCCT=NO \
-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_lzma=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_nlohmannjson=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON \
-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_cgns=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_exprtk=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_fast_float=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_fmt=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_ioss=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_token=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_utf8=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_verdict=OFF
ninja
DESTDIR=$PKG ninja install
rm -rf "$PKG/usr/share/doc"
The switches, and why each is set:
-DLOGURU_STACKTRACES=0— Build VTK’s bundled loguru logger without stack traces. On Linux it prints them through<execinfo.h>, which musl does not have.-DCMAKE_SKIP_INSTALL_RPATH=ON— Install the libraries and modules with no RPATH. They are all in/usr/lib, where the loader looks in any case, and the package lint warns on an RPATH that names it (see What the package lint refuses).-DVTK_BUILD_TESTING=OFF,-DVTK_BUILD_EXAMPLES=OFF,-DVTK_BUILD_DOCUMENTATION=OFF,-DVTK_USE_LARGE_DATA=OFF— No tests, examples or Doxygen documentation, and none of the large test data, which VTK downloads.-DVTK_USE_MPI=OFF,-DVTK_GROUP_ENABLE_MPI=NO— No MPI, and none of the parallel modules that need it.-DVTK_USE_CUDA=OFF— No CUDA.-DVTK_USE_X=ON,-DVTK_OPENGL_HAS_EGL=ON— Build both the X11 (GLX) and the EGL render windows. VTK chooses at run time: the X11 window when a GLX context can be made, which on KDOS is through Xwayland, and the EGL window otherwise, so a program with no display still renders off screen.VTK_DEFAULT_OPENGL_WINDOWin the environment forces one.-DVTK_OPENGL_USE_GLES=OFF— Desktop OpenGL, not OpenGL ES.-DVTK_WRAP_PYTHON=ON,-DPython3_EXECUTABLE=/usr/bin/python3— Build the Python bindings, against the system Python. FreeCAD’s FEM post-processing is built without its VTK filters when they are missing.-DVTK_WRAP_JAVA=OFF— No Java bindings.-DVTK_GROUP_ENABLE_Qt=NO— None of the Qt modules, VTK’s Qt widgets and views.-DVTK_MODULE_ENABLE_VTK_IOFFMPEG=NO,-DVTK_MODULE_ENABLE_VTK_IOOCCT=NO— Leave out the module that reads and writes video through FFmpeg and the reader for STEP and IGES files through OpenCASCADE.-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON— This switch and every otherVTK_MODULE_USE_EXTERNAL_VTK_switch set toON(eigen,expat,freetype,jpeg,jsoncpp,libproj,libxml2,lz4,lzma,netcdf,nlohmannjson,ogg,png,pugixml,sqlite,theora,tiff,zlib) build against this tree’s port of each library instead of VTK’s bundled copy. Every one of those ports is independs.-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=OFF— Keep VTK’s bundled HDF5, whose symbols VTK renames (vtkhdf5_*). VTK is written against the HDF5 1.x API, the hdf5 port is 2.x, and the renamed copy cannot clash with it in one process.-DVTK_MODULE_USE_EXTERNAL_VTK_fmt=OFF— Keep VTK’s bundled fmt, an 11.x copy in a renamed namespace. The bundled IOSS library callsfmt::localtime, which the fmt port’s major version has removed.-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=OFF,-DVTK_MODULE_USE_EXTERNAL_VTK_utf8=OFF— Keep the bundled gl2ps and utfcpp, although both are ports: VTK’s gl2ps is renamed tovtkgl2ps_*and draws through VTK’s own GL loader, and its utfcpp sits in a renamed namespace, so neither can clash with the port’s library in one process.-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=OFF— Keep the bundled libHaru, which is VTK’s own fork.-DVTK_MODULE_USE_EXTERNAL_VTK_cgns=OFF,-DVTK_MODULE_USE_EXTERNAL_VTK_exprtk=OFF,-DVTK_MODULE_USE_EXTERNAL_VTK_fast_float=OFF,-DVTK_MODULE_USE_EXTERNAL_VTK_ioss=OFF,-DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF,-DVTK_MODULE_USE_EXTERNAL_VTK_token=OFF,-DVTK_MODULE_USE_EXTERNAL_VTK_verdict=OFF— Keep the bundled copies of libraries that are not ports.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/vtk, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf vtk-9.5.2-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/vtk, and runs the triggers its paths call for.
Contents
Installed programs: vtkParseJava-9.5, vtkProbeOpenGLVersion-9.5, vtkWrapHierarchy-9.5, vtkWrapJava-9.5, vtkWrapPython-9.5, vtkWrapPythonInit-9.5, vtkWrapSerDes-9.5, vtkpython.
Installed libraries: libvtkChartsCore-9.5.so, libvtkCommonColor-9.5.so, libvtkCommonComputationalGeometry-9.5.so, libvtkCommonCore-9.5.so, libvtkCommonDataModel-9.5.so, libvtkCommonExecutionModel-9.5.so, libvtkCommonMath-9.5.so, libvtkCommonMisc-9.5.so, libvtkCommonPython-9.5.so, libvtkCommonSystem-9.5.so, libvtkCommonTransforms-9.5.so, libvtkDICOMParser-9.5.so, libvtkDomainsChemistry-9.5.so, libvtkDomainsChemistryOpenGL2-9.5.so, libvtkFiltersAMR-9.5.so, libvtkFiltersCellGrid-9.5.so, libvtkFiltersCore-9.5.so, libvtkFiltersExtraction-9.5.so, libvtkFiltersFlowPaths-9.5.so, libvtkFiltersGeneral-9.5.so, libvtkFiltersGeneric-9.5.so, libvtkFiltersGeometry-9.5.so, libvtkFiltersGeometryPreview-9.5.so, libvtkFiltersHybrid-9.5.so, libvtkFiltersHyperTree-9.5.so, libvtkFiltersImaging-9.5.so, libvtkFiltersModeling-9.5.so, libvtkFiltersParallel-9.5.so, libvtkFiltersParallelImaging-9.5.so, libvtkFiltersPoints-9.5.so, libvtkFiltersProgrammable-9.5.so, libvtkFiltersPython-9.5.so, libvtkFiltersReduction-9.5.so, libvtkFiltersSMP-9.5.so, libvtkFiltersSelection-9.5.so, libvtkFiltersSources-9.5.so, libvtkFiltersStatistics-9.5.so, libvtkFiltersTemporal-9.5.so, libvtkFiltersTensor-9.5.so, libvtkFiltersTexture-9.5.so, libvtkFiltersTopology-9.5.so, libvtkFiltersVerdict-9.5.so, libvtkGeovisCore-9.5.so, libvtkIOAMR-9.5.so, libvtkIOAsynchronous-9.5.so, libvtkIOCGNSReader-9.5.so, libvtkIOCONVERGECFD-9.5.so, libvtkIOCellGrid-9.5.so, libvtkIOCesium3DTiles-9.5.so, libvtkIOChemistry-9.5.so, libvtkIOCityGML-9.5.so, libvtkIOCore-9.5.so, libvtkIOERF-9.5.so, libvtkIOEnSight-9.5.so, libvtkIOEngys-9.5.so, libvtkIOExodus-9.5.so, libvtkIOExport-9.5.so, libvtkIOExportGL2PS-9.5.so, libvtkIOExportPDF-9.5.so, libvtkIOFDS-9.5.so, libvtkIOFLUENTCFF-9.5.so, libvtkIOGeometry-9.5.so, libvtkIOHDF-9.5.so, libvtkIOIOSS-9.5.so, libvtkIOImage-9.5.so, libvtkIOImport-9.5.so, libvtkIOInfovis-9.5.so, libvtkIOLANLX3D-9.5.so, libvtkIOLSDyna-9.5.so, libvtkIOLegacy-9.5.so, libvtkIOMINC-9.5.so, libvtkIOMotionFX-9.5.so, libvtkIOMovie-9.5.so, libvtkIONetCDF-9.5.so, libvtkIOOggTheora-9.5.so, libvtkIOPLY-9.5.so, libvtkIOParallel-9.5.so, libvtkIOParallelXML-9.5.so, libvtkIOSQL-9.5.so, libvtkIOSegY-9.5.so, libvtkIOTecplotTable-9.5.so, libvtkIOVeraOut-9.5.so, libvtkIOVideo-9.5.so, libvtkIOXML-9.5.so, libvtkIOXMLParser-9.5.so, libvtkImagingColor-9.5.so, libvtkImagingCore-9.5.so, libvtkImagingFourier-9.5.so, libvtkImagingGeneral-9.5.so, libvtkImagingHybrid-9.5.so, libvtkImagingMath-9.5.so, libvtkImagingMorphological-9.5.so, libvtkImagingSources-9.5.so, libvtkImagingStatistics-9.5.so, libvtkImagingStencil-9.5.so, libvtkInfovisCore-9.5.so, libvtkInfovisLayout-9.5.so, libvtkInteractionImage-9.5.so, libvtkInteractionStyle-9.5.so, libvtkInteractionWidgets-9.5.so, libvtkParallelCore-9.5.so, libvtkParallelDIY-9.5.so, libvtkPythonContext2D-9.5.so, libvtkPythonInterpreter-9.5.so, libvtkRenderingAnnotation-9.5.so, libvtkRenderingCellGrid-9.5.so, libvtkRenderingContext2D-9.5.so, libvtkRenderingContextOpenGL2-9.5.so, libvtkRenderingCore-9.5.so, libvtkRenderingFreeType-9.5.so, libvtkRenderingGL2PSOpenGL2-9.5.so, libvtkRenderingGridAxes-9.5.so, libvtkRenderingHyperTreeGrid-9.5.so, libvtkRenderingImage-9.5.so, libvtkRenderingLICOpenGL2-9.5.so, libvtkRenderingLOD-9.5.so, libvtkRenderingLabel-9.5.so, libvtkRenderingOpenGL2-9.5.so, libvtkRenderingSceneGraph-9.5.so, libvtkRenderingUI-9.5.so, libvtkRenderingVolume-9.5.so, libvtkRenderingVolumeOpenGL2-9.5.so, libvtkRenderingVtkJS-9.5.so, libvtkTestingCore-9.5.so, libvtkTestingRendering-9.5.so, libvtkViewsContext2D-9.5.so, libvtkViewsCore-9.5.so, libvtkViewsInfovis-9.5.so, libvtkWrappingPythonCore3.14-9.5.so, libvtkWrappingTools-9.5.so, libvtkcgns-9.5.so, libvtkexodusII-9.5.so, libvtkfmt-9.5.so, libvtkgl2ps-9.5.so, libvtkglad-9.5.so, libvtkhdf5-9.5.so, libvtkhdf5_hl-9.5.so, libvtkioss-9.5.so, libvtkkissfft-9.5.so, libvtklibharu-9.5.so, libvtkloguru-9.5.so, libvtkmetaio-9.5.so, libvtksys-9.5.so, libvtktoken-9.5.so, libvtkverdict-9.5.so.
Installed directories: /usr/include/vtk-9.5, /usr/lib/cmake/vtk-9.5, /usr/lib/python3.14/site-packages/vtkmodules, /usr/lib/vtk-9.5, /usr/share/licenses/VTK, /usr/share/licenses/vtk.