# SlicerVMTK not building for SlicerPreview on cdash

**URL:** <https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605>\
**Category:** VMTK\
**Created:** [April 17, 2025, 5:11pm UTC](https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605 "2025-04-17T17:11:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [April 17, 2025, 5:11pm UTC](https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605/1 "2025-04-17T17:11:08Z")

</div>

SlicerVMTK is not building on cdash for SlicerPreview while it does build for SlicerStable. The error messages relate to the VMTK library itself.

FYI, hoping for an investigation.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [April 17, 2025, 5:17pm UTC](https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605/2 "2025-04-17T17:17:11Z")

</div>

SlicerPreview is now using a version based on VTK 9.4.2 ([ENH: Update default VTK version in external project from 9.2 to 9.4 · Slicer/Slicer@01624f0 · GitHub](https://github.com/Slicer/Slicer/commit/01624f0aa67be6a4522b8ce33319995ddd0eb421)) while SlicerStable 5.8.x is using a version based on VTK 9.2.

See the below VTK commit which change `vtkCellLinks::BuildLinks` to no longer have an input as warned in the SlicerPreview [Windows build of SlicerVMTK](https://slicer.cdash.org/viewBuildError.php?buildid=3762482). This VTK commit was first part of the VTK 9.3 release.

> <https://github.com/Kitware/VTK/commit/6adb882209baddfed5cbd4eda4a06cc50e75ef6f>
>
> vtkAbstractCellLinks now use the SetDataSet/BuildLinks like vtkLocators instead …of
> BuildLinks(dataset) which has been deprecated. Because of this change now we are
> able to store built time and check the dataset time to avoid unnecessary rebuilding
> of the links. Also deprecated vtkUnstructuredGrid::GetCellLinks() function.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [April 17, 2025, 6:40pm UTC](https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605/3 "2025-04-17T18:40:50Z")

</div>

> [@jamesobutler](#):
>
> a version based on VTK 9.4.2

Thank you for the information, at least I know the source of this issue.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [April 17, 2025, 9:01pm UTC](https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605/4 "2025-04-17T21:01:30Z")

</div>

When Slicer is built with VTK 9.4, in `VTK-build/Common/Core/vtkVersionMacros.h`, there is

> #define VTK\_MINOR\_VERSION 2

In my former build with VTK 9.2, this file contains:

> #define VTK\_BUILD\_VERSION 20230607

SlicerVMTK could be built with Slicer/VTK9.4 with this patch:

```auto
diff --git a/vtkVmtk/ComputationalGeometry/vtkvmtkSimplifyVoronoiDiagram.cxx b/vtkVmtk/ComputationalGeometry/vtkvmtkSimplifyVoronoiDiagram.cxx
index 3ac28f0..ebcad5a 100644
--- a/vtkVmtk/ComputationalGeometry/vtkvmtkSimplifyVoronoiDiagram.cxx
+++ b/vtkVmtk/ComputationalGeometry/vtkvmtkSimplifyVoronoiDiagram.cxx
@@ -195,8 +195,9 @@ int vtkvmtkSimplifyVoronoiDiagram::RequestData(
   // return 0;
   // }
   poly->SetPolys(currentPolys);
-  
-#if (VTK_MAJOR_VERSION >= 9 && VTK_MINOR_VERSION >= 0 && VTK_BUILD_VERSION >= 20221108)
+ 
+// #if (VTK_MAJOR_VERSION >= 9 && VTK_MINOR_VERSION >= 0 && VTK_BUILD_VERSION >= 20221108)
+#if (VTK_MAJOR_VERSION >= 9 && VTK_MINOR_VERSION >= 0)
   currentLinks->SetDataSet(poly);
   currentLinks->BuildLinks();
 #else
@@ -296,7 +297,8 @@ int vtkvmtkSimplifyVoronoiDiagram::RequestData(
     // #pragma message "vtkvmtkSimplifyVoronoiDiagram::RequestData not functional. Must be updated based on Kitware/VTK@88efc809a"
     // vtkErrorMacro(<< "!");
     poly->SetPolys(currentPolys);
-#if (VTK_MAJOR_VERSION >= 9 && VTK_MINOR_VERSION >= 0 && VTK_BUILD_VERSION >= 20221108)
+// #if (VTK_MAJOR_VERSION >= 9 && VTK_MINOR_VERSION >= 0 && VTK_BUILD_VERSION >= 20221108)
+#if (VTK_MAJOR_VERSION >= 9 && VTK_MINOR_VERSION >= 0)
     currentLinks->SetDataSet(poly);
     currentLinks->BuildLinks();
 #else

```

It’s probably not a definite fix, just a hint rather.

`VTK_BUILD_VERSION` is not being rightly set in `vtkVersionMacros.h`.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [April 17, 2025, 10:37pm UTC](https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605/5 "2025-04-17T22:37:28Z")

</div>

> [@chir.set](#):
>
> When Slicer is built with VTK 9.4, in `VTK-build/Common/Core/vtkVersionMacros.h`, there is
> 
> > #define VTK\_MINOR\_VERSION 2

If this is a clean build of Slicer rather than incremental build it should be minor version of 4 and build version of 2. The build version is not a date because it is based on a released tag rather than a nightly dev build.

> <https://github.com/Slicer/VTK/blob/454bb391dff78c6ff463298a5143ab5b4f0aa083/CMake/vtkVersion.cmake#L2-L4>

and what is used in SlicerStable 5.8.x:

> <https://github.com/Slicer/VTK/blob/59ec450206012e86d4855bc669800499254bfc77/CMake/vtkVersion.cmake#L2-L4>

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [April 18, 2025, 8:45am UTC](https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605/6 "2025-04-18T08:45:19Z")

</div>

> [@jamesobutler](#):
>
> `set(VTK_BUILD_VERSION 2)`

It’s consistent then.

I am doing a clean Slicer build and here is the content of `vtkVersionMacros.h` in the build tree.

```auto
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
#ifndef vtkVersionMacros_h
#define vtkVersionMacros_h

#include "vtkVersionQuick.h"

/* Note: this file is deliberately both valid C and valid C++. */

#define VTK_BUILD_VERSION 2
#define VTK_VERSION "9.4.1"

#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION

#define VTK_VERSION_NUMBER \
  VTK_VERSION_CHECK(VTK_MAJOR_VERSION, VTK_MINOR_VERSION, VTK_BUILD_VERSION)

#endif

```

Since `vtkvmtkSimplifyVoronoiDiagram.cxx` is looking for `VTK_BUILD_VERSION >= 20221108` in the revision being built, SlicerVMTK build is bound to fail.

This seems to have been addressed in [6c189dd](https://github.com/vmtk/vmtk/blame/6c189dd6ee644a466498bd382b0c19229f20daa5/vtkVmtk/ComputationalGeometry/vtkvmtkSimplifyVoronoiDiagram.cxx#L199). May be SlicerVMTK should pull a later revision.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [April 18, 2025, 2:37pm UTC](https://discourse.slicer.org/t/slicervmtk-not-building-for-slicerpreview-on-cdash/42605/7 "2025-04-18T14:37:56Z")

</div>

I built VMTK at [6c189dd6](https://github.com/vmtk/vmtk/commit/6c189dd6ee644a466498bd382b0c19229f20daa5) with the following errors:

```auto
CMake Error at /home/arc/src/SlicerExtension-VMTK-SuperBuild9/VMTK-build/CMake/vtkWrapPython.cmake:209 (find_package):
  By not providing "FindPythonLibs.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "PythonLibs", but CMake did not find one.

```

If the changes in CMakeLists introduced by that commit are reverted, VMTK builds fine. Then SlicerVMTK can be built in turn.

This commit ([6c189dd6](https://github.com/vmtk/vmtk/commit/6c189dd6ee644a466498bd382b0c19229f20daa5)) probably needs the python changes it is expecting and they do not seem to be compatible with Slicer python.

It looks like there _might_ be a need for a SlicerPreview specific branch in the VMTK repository. It won’t be an easy task to maintain SlicerVMTK otherwise.

Or may be there’s some simpler solution.
