<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" class="gmail_signature" data-smartmail="gmail_signature"><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>