the command works, compiles correctly, and when I run the program, it successfully run on the device.
However, if I show the invocations with “-v” and try to run the commands one by one it does not work and in particular I get an error with the last command which is the linking part with “ld”.
The error i get is the following:
you are more likely to get answers to frontend questions asking on cfe-dev. However, your output shows that you are using clang-ykt which isn't supported upstream so this is not the right place for your questions. Nevertheless, I'll answer some because the same "problem" will arise with (upstream) trunk.
Hi,
I am having some trouble to understand how the clang driver works for
OpenMP offloading.
For example, if I run the following command (with the -v flag):
the command works, compiles correctly, and when I run the program, it
successfully run on the device.
(which would not be the case for upstream trunk yet...)
However, if I show the invocations with "-v" and try to run the
commands one by one it does not work and in particular I get an error
with the last command which is the linking part with "ld".
The error i get is the following:
/usr/bin/ld: cannot open linker script file
/tmp/offloading_success-2b4739.lk [1]: No such file or directory
Where is this ".lk" file generated? Is there a missing commands in the
invocations?
The linker script is generated by Clang's driver (both in clang-ykt and trunk) and is deleted after its usage which is the default for temporary files. If you want to inspect the intermediate files, I suggest adding --save-temps which will dump a bunch of files to the current directory. (AFAIK this will result in more files than generated by default so that developers have more intermediate steps to look at.)
thanks for the answer.
For now I can use the “–save-temps” flag to keep my investigation.
Do you know what’s the timeline for integrating offloading for NVidia GPUs upstream?
I remember seeing a big patch for integrating OpenMP target generation in the clang driver and I thought it was already accepted and committed, but I might be wrong.