I frequently use the nvc/nvc++ compiler for OpenACC. Recently I started generating dependency files to make the build process incremental.
In gcc/g++ I use the ‘-MMD -MP’ flags while compiling object files. gcc by default generates the .d files in the same directory as the .o files when compiled. I realise that it is different with nvc/nvc++:
-MP does not work with it.
.d files are generated in the directory where the command (nvc/nvc++) is run from.
I want the dependency files to be generated in the same directory as the object files as it reduces clutter. To achieve this I tried using the C preprocessor (cpp) to generate the .d files and then compiling using nvc/nvc++ in the same make rule. But nvc/nvc++ does not detect changes in header files if done that way.
Is there any way to achieve my requirement in the NVIDIA HPC SDK (21.9) I am using? Why does nvc/nvc++ not generate the .d files in the same directory as the object files? Any plan to add this in future?