ninja error: multiple rules generate


I’m not sure wether the error is connected with CMake or ninja but still I try to ask here.

I have a big project (based on Slicer 3D) and I’m trying to build it with CMake 3.19.2 (I also tested 3.21.2 master branch) and ninja 1.10.0 on Ubuntu 20.04.

If the compilation is successful from the first pass (say build dir is empty and cmake .., cmake --build . is successful) then there is no errors.
But if the compilation failed and I try to reconfigure and rebuild the project then I get error:

CMake Error:

   '/home/user/bin/ninja' '-C' '/home/user/.vs/C/2876e1d5-5c56-4cf4-9511-dda80338aea1/out/build/Linux-GCC-Ninja-Debug/HDF5-build' '-t' 'recompact'

  failed with:

   ninja: error: multiple rules generate src/shared/shared_gen_SRCS.stamp1 [-w dupbuild=err]

I have no idea what is wrong but I tried to google and found some related topics but I’m not an advanced ninja user so I don’t understand what is wrong and how can solve this…

This is a problem with Slicer’s embedded hdf5. Please file an issue with the Slicer team.

1 Like

Thank you!
For now I use unix makefiles generator as I could not solve the problem. Probably later I will try to figure out what is wrong with my hdf5 implementation in superbuild.