<div dir="ltr"><div>Hi Ye,</div><div><br></div><div>I previously worked on a patch for this issue, and Hal was one of the reviewers:<br></div><div><br></div><div>  <a href="https://reviews.llvm.org/D55725">https://reviews.llvm.org/D55725</a></div><div><br></div><div>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.<br></div><div><br></div><div>Would you like to take over this work?<br></div><div><br></div><div>Joel<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 5, 2019 at 6:37 PM Ye Luo via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org">openmp-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div>Today I hit an issue and took me quite a while to find out what the problem was.</div><div>Even though now I understand the problem, I don't know which piece should be fixed.</div><div><br></div><div>My workstation has ubuntu 18.04 and libomp from package manager is installed on the machine.</div><div>Thus I got libomp.so and libomp.so.5 under /usr/lib/x86_64-linux-gnu/.</div><div>I need the dev llvm and thus build my own llvm with libomp and libomptarget enabled.<br></div><div>When I compile and link a simple main.</div><div>clang++ -fopenmp main.cpp # using my clang build.<br></div><div>ldd a.out<br></div><div>  libomp.so.5 => /usr/lib/x86_64-linux-gnu/libomp.so.5 (0x00007fdf0701f000)</div><div>The OS version gets picked up.<br></div><div>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.<br></div><div>Q1. why clang doesn't put -L lib_of_my_clang_build by default?</div><div>Now I compile with offload flag<br></div><div>clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda main.cpp # using my clang build.</div><div>I got segfault when my build libomptarget tries to talk to libomp from the OS.</div><div>Q2, is there no check of consistency between libomp and libomptarget?</div><div><br></div><div>I can put -L lib_of_my_clang_build as a workaround but this is ugly.</div><div>Need more experienced people to find a clean solution.</div><div><br></div><div>Best,<br></div><div>Ye<br></div><div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr">===================<br>
Ye Luo, Ph.D.<br>Computational Science Division & Leadership Computing Facility<br>
Argonne National Laboratory</div></div></div></div></div></div></div>
_______________________________________________<br>
Openmp-dev mailing list<br>
<a href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
</blockquote></div></div>