VTK 9 build

Building VTK from development sources is broken. I have tried to narrow this down and get the following error:
make -f CMakeFiles/vtkIOParallelXMLPython.dir/build.make CMakeFiles/vtkIOParallelXMLPython.dir/depend
make: *** No rule to make target ‘…/IO/XML/vtkXMLPartitionedDataSetWriter.h’, needed by ‘CMakeFiles/vtkIOParallelXMLPython/vtkXMLPPartitionedDataSetWriterPython.cxx’. Stop.

Does anyone know how I can make progress on fixing this?

These “No rule to make target” errors are almost always caused by stale “make” rule dependencies in the build tree. If you delete your build tree and start over, the error should disappear.

This stale dependency problem is specific to the way VTK uses CMake’s “Makefile” generator, so you can avoid it in the future by doing builds with ninja instead (cmake -G Ninja …).

Those files recently moved, so you’ll probably just want to nuke the modules’ build directory and reconfigure. That should be enough to get things to work, but there may be other places which contain the Python bits (toplevel/CMakeFiles?) which may need manually cleaned up.

But as @dgobbi said, Ninja does it better (though CMake 3.20 provides Makefiles with better support, it needs to be explicitly enabled there).

Thank you to both of you. Blowing away the build directory worked. Thanks for the tip to use Ninja.