[Openmp-dev] libomp linking issue

Joel E. Denny via Openmp-dev openmp-dev at lists.llvm.org
Thu Dec 5 16:47:14 PST 2019


Hi Ye,

I previously worked on a patch for this issue, and Hal was one of the
reviewers:

  https://reviews.llvm.org/D55725

I waited on some related patches to be upstreamed (I believe D59168 and
D62469, and there may have been followup patches I missed), and then I
never got back to it.

Would you like to take over this work?

Joel

On Thu, Dec 5, 2019 at 6:37 PM Ye Luo via Openmp-dev <
openmp-dev at lists.llvm.org> wrote:

> Hi all,
> Today I hit an issue and took me quite a while to find out what the
> problem was.
> Even though now I understand the problem, I don't know which piece should
> be fixed.
>
> My workstation has ubuntu 18.04 and libomp from package manager is
> installed on the machine.
> Thus I got libomp.so and libomp.so.5 under /usr/lib/x86_64-linux-gnu/.
> I need the dev llvm and thus build my own llvm with libomp and
> libomptarget enabled.
> When I compile and link a simple main.
> clang++ -fopenmp main.cpp # using my clang build.
> ldd a.out
> libomp.so.5 => /usr/lib/x86_64-linux-gnu/libomp.so.5 (0x00007fdf0701f000)
> The OS version gets picked up.
> Even I put my clang lib on the LD_LIBRARY_PATH. libomp.so doesn't get
> picked up due to ".5" expected by a.out.
> Q1. why clang doesn't put -L lib_of_my_clang_build by default?
> Now I compile with offload flag
> clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda main.cpp # using my
> clang build.
> I got segfault when my build libomptarget tries to talk to libomp from the
> OS.
> Q2, is there no check of consistency between libomp and libomptarget?
>
> I can put -L lib_of_my_clang_build as a workaround but this is ugly.
> Need more experienced people to find a clean solution.
>
> Best,
> Ye
> ===================
> Ye Luo, Ph.D.
> Computational Science Division & Leadership Computing Facility
> Argonne National Laboratory
> _______________________________________________
> 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/20191205/188d347e/attachment-0001.html>


More information about the Openmp-dev mailing list