[Openmp-dev] Offloading build fails

Itaru Kitayama via Openmp-dev openmp-dev at lists.llvm.org
Mon Nov 4 14:48:31 PST 2019


Switching to libc++ did not help much:
$ cat example.cpp
#include <iostream>
int main() {
#pragma omp target parallel for
for (int i=0;i<10;i++) {
}
}

$ $ clang++ -fopenmp -fopenmp-targets=nvptx64 -stdlib=libc++ example.cpp
nvlink error   : Undefined reference to '_Z13checkSPMDModeP5ident' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z25GetLogicalThreadIdInBlockb' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z14GetOmpThreadIdib' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z21GetNumberOfOmpThreadsb' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z12GetOmpTeamIdv' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z19GetNumberOfOmpTeamsv' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to
'_Z22setExecutionParameters13ExecutionMode11RuntimeMode' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z18GetThreadIdInBlockv' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z25GetNumberOfThreadsInBlockv' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z9GetLaneIdv' in
'/tmp/example-b3be69.cubin'
nvlink error   : Undefined reference to '_Z9GetWarpIdv' in
'/tmp/example-b3be69.cubin'
clang-10: error: nvlink command failed with exit code 255 (use -v to see
invocation)

Tested on POWER8

On Tue, Nov 5, 2019 at 7:43 AM Jon Chesterfield <
jonathanchesterfield at gmail.com> wrote:

> On Mon, Nov 4, 2019 at 10:16 PM Itaru Kitayama <itaru.kitayama at gmail.com>
> wrote:
>
>> Can you submit a patch to upstream? In the meantime, I workaround by
>> using libc++.
>>
>
> The 'right' fix is to stop cuda putting symbols in namespace std::, but
> that ship has sailed. Or possibly openmp variants as a future repair.
>
> I've 'raised a concern' on the guilty commit (
> https://reviews.llvm.org/rC361066) in the hope that someone else fixes
> it. My next step would probably be to propose a reverting commit and put
> the author of that patch down as reviewer.
>
> Cheers
>
> Jon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20191105/cc76d39f/attachment.html>


More information about the Openmp-dev mailing list