[Openmp-dev] nvlink reported undefined reference

Alexey Bataev via Openmp-dev openmp-dev at lists.llvm.org
Tue Nov 5 05:15:55 PST 2019


Jon, try to manually remove old .bc files generated for NVPTX runtime library. You may use the old ones, sometimes they are not rebuilt automatically. Also, what tests are you trying to investigate? For me, the tests from check-libomptarget-nvptx are failed.

Best regards,
Alexey Bataev

5 нояб. 2019 г., в 08:06, Jon Chesterfield via Openmp-dev <openmp-dev at lists.llvm.org> написал(а):


Message: 2
Date: Tue, 5 Nov 2019 02:54:05 +0000
From: "Doerfert, Johannes via Openmp-dev" <openmp-dev at lists.llvm.org<mailto:openmp-dev at lists.llvm.org>>
To: Shilei Tian <tianshilei1992 at gmail.com<mailto:tianshilei1992 at gmail.com>>
Subject: Re: [Openmp-dev] nvlink reported undefined reference when
        building OpenMP offloading program


I think Jon (CCed) is aware and working on it:
  https://reviews.llvm.org/rG764c8420e4b8fc1libomptarget1a9fa94d00f4ee617aa754cb2<https://reviews.llvm.org/rG764c8420e4b8fc11a9fa94d00f4ee617aa754cb2>

On 11/04, Shilei Tian via Openmp-dev wrote:
> Hi,
>
> I was trying to build an OpenMP offloading program. nvlink always reported following error:
>
> nvlink error   : Undefined reference to '_Z25GetLogicalThreadIdInBlockb' in '/tmp/main-02fcf5.cubin'

Hi Shilei,

Thanks for the comprehensive report. I am indeed looking into this.

That you're building for X86 means the problem isn't isolated to POWER8, which means I can stop looking at cross compilation. I'll update the discussion. Thanks!

OpenMP still works for me. My nvptx build is a bit precarious though because trunk conflicts with libstdc++, so the corresponding invocation is:

~/llvm-install/bin/clang --cuda-gpu-arch=sm_50 -fopenmp -fopenmp-targets=nvptx64 test.cu<http://test.cu>  -nocudainc -L~/llvm-install/lib
LD_LIBRARY_PATH=~/llvm-build/lib ./a.out

Looking at symbols in the cuda runtime libraries suggests all is well, at least on my machine.

I believe replacing INLINE with DEVICE in openmp/libomptarget/deviceRTL/nvptx/src/support.cu<http://support.cu> will unblock people. I don't want to propose that as a patch until I can reproduce locally.

Alternatively, using clang instead of nvcc would probably resolve this.
-DCUDA_HOST_COMPILER=`which clang`

Regards,

Jon
_______________________________________________
Openmp-dev mailing list
Openmp-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20191105/e9abe48f/attachment.html>


More information about the Openmp-dev mailing list