Dear NVHPC experts,
I recently discovered that combining versions of CMake, Ninja and nvc++ leads to missed build dependencies. I reported this as a CMake issue:
but the CMake developers’ response suggests that a fix might be needed in nvc++ itself:
nvc++compiler does not write the object file with
-MT, that is a bug that prevents it from being used with Ninja and needs to be fixed by NVIDIA.
The details are all in the linked issue, but in essence the issue is that passing the -MT option to nvc++ stops the object file from being written:
$ nvc++ -MDmain-without-MT.d -o main-without-MT.o main.cpp $ nvc++ -MDmain-with-MT.d -MT main-with-MT.o -o main-with-MT.o main.cpp $ ls main-without-MT.o main-with-MT.o ls: cannot access main-with-MT.o: No such file or directory main-without-MT.o $ cat main-without-MT.d main.o : main.cpp ... $ cat main-with-MT.d main-with-MT.o : main.cpp ...
The -MT option is documented in nvc++ -help, although it seems to be missing from the online help. I hope this is just a trivial bug that can be fixed easily.