How can we avoid removing all VTK directories when updating slicer

(@chir.set asked the following in Commit 69e26835e would burn my discrete GPU!)

Secondly, I need your advice for another issue.

Every time I run 'git checkout ', I must remove completely VTKv9{,-build,-prefix} directories to have a successful build. Else, there are errors like :

make[5]: *** No rule to make target ‘/home/arc/src/Slicer-SuperBuild/VTKv9/Common/Core/vtkAngularPeriodicDataArray.h’, needed by ‘Wrapping/Python/vtkAngularPeriodicDataArrayPython.cxx’. Stop.

Here, it’s vtkAngularPeriodicDataArray.h, but it can be any other file in a similar complaint.

How can we avoid removing all VTK directories whenever we checkout a commit ? It’s quite a big download. Even if I unpack a saved VTKv9 directory from a previously failed build, its contents get cleared and pulled from git again.

Thank you.

It should never be necessary to delete the VTKv9 git directory, – in the off chance the source git directory is left in a transient state by the build system, you can run a hard git reset to clean it up and avoid re-downloading that.

However, rebuilds are also time-consuming… The -build or -prefix directories should almost never need to be deleted. However, the error you listed could be caused by an out-of-sync superbuild after major changes, so if it happens again, try re-running cmake in the superbuild directory (one level above Slicer-build) – cmake . should do the trick at command line, or click Generate in the GUi.

1 Like

That did the trick, thanks.