<HTML><BODY><div>Hi Johannes,</div><div> </div><div>Thank you for response</div><div> </div><div>It seems that I don’t have<strong> </strong><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">libthread. Moreover it is highly likely that omp.h and libomp.so that I used to provide as parameters to clang are not shipped with clang 5 :)</span></div><div> </div><div>I think I should now forget about xeus-cling for a while and simply build the code with latest (or any) version of clang with OpenMP.</div><div> </div><div>I’ve tried to do the following:</div><div><em>$ sudo apt-get install clang-10</em></div><div><em>$ sudo apt-get install libomp-5-dev</em></div><div> </div><div>Now I want to find where are these packages were installed:</div><div><em>$ find  /usr -iname clang-10<br><u>/usr/lib/llvm-10/bin/clang-10<br>/usr/lib/cmake/clang-10<br>/usr/share/doc/clang-10<br>/usr/share/bash-completion/completions/clang-10<br>/usr/share/lintian/overrides/clang-10<br>/usr/bin/clang-10</u></em></div><div> </div><div><em>$ find  /usr -iname libomp-10-dev<br><u>/usr/share/doc/libomp-10-dev</u></em></div><div> </div><div>So I’m afraid that <em><u>libomp-10-dev</u></em> contains only some docs and there is no library  <em><u>libomp-10-dev.so</u></em> (or something)</div><div> </div><div>Could you please guide me how to properly install clang with OpenMP that I could build my test script?</div><div> </div><div>I’m on Ubuntu  20.04, x64</div><div><em>$ cat /etc/lsb-release</em></div><div><u><em>DISTRIB_ID=Ubuntu<br>DISTRIB_RELEASE=20.04<br>DISTRIB_CODENAME=focal<br>DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"</em></u></div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Среда, 23 декабря 2020, 0:48 +03:00 от Johannes Doerfert <johannesdoerfert@gmail.com>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16086736901531667474_BODY">Hi Kerim,<br><br>I tried to help below. Looking at xeus-cling I did not immediately see<br>why clang 5 is<br>required. If this doesn't work as described below, I might spend time<br>trying to get it<br>to run with clang 11 ;)<br><br>On 12/22/20 1:57 PM, Керим Хемраев via cfe-dev wrote:<br>> Hi,<br>><br>> I’m struggling with compiling simple OpenMP program with clang 5.0.0.<br>> Here is the code (foo.cxx):<br>><br>> #include   "omp.h"<br>> #include   <stdio.h><br>> int   main ( void ) {<br>>    #pragma   omp   parallel<br>>    printf ( "thread %d \n " ,  omp_get_thread_num ());<br>> }<br>><br>> As I use clang as part of xeus-cling my clang installation is inside conda packages:<br>> $ which clang<br>> /home/tasik/miniconda3/envs/cling/bin/clang<br>><br>> As this clang package does’t have omp.h I provide additional directories to find omp.h and libomp.so<br>> To compile the code I use the command:<br>> $ clang -fopenmp -I/home/../usr/lib/llvm-10/include/openmp/ -L/home/../usr/lib/llvm-10/lib foo.cxx<br>><br>> And I get errors:<br>> /usr/bin/ld: cannot find /lib64/libpthread.so.0<br>> /usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a<br>> clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)<br><br>The error basically means clang looks for the libthread libraries and<br>cannot find them.<br>Check on you system where they are and provide the path via -L to clang.<br>That might allow<br>you to proceed. That said, I don't think you are able to mix clang 5 and<br>llvm 10 as you<br>do now. The headers and libraries clang might pick up need to be<br>consistent (with the clang<br>version). At least, you need to make sure `omp.h` and `libomp.so` are<br>the ones shipped with<br>clang 5.<br><br>~ Johannes<br><br><br>><br>> I really need some help to undertand how to work with clang 5.0.0 OpenMP<br>> And I think that it is difficult to update clang’s version as xeus-cling requires mentioned 5.0.0 version...<br>><br>><br>> With respect,<br>> kerim<br>><br>> _______________________________________________<br>> cfe-dev mailing list<br>> <a href="/compose?To=cfe%2ddev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a></div></div></div></div></blockquote><div> <div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>С уважением,<br>Керим Хемраев<br>kerim.khemraev@mail.ru</div></div></div><div> </div></div></BODY></HTML>