<HTML><BODY><div>How can check if OpenMP is enabled in my clang package?<br><br> <blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Вторник, 22 декабря 2020, 23:57 +03:00 от Marcus Johnson <marcusljohnson1991@gmail.com>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16086706581072521126_BODY"><div class="cl_681960"><div>Another thing:</div><div> </div><div>Clang can be compiled without OpenMP support, which removes the omp.h header, libomp.dylib, and tablegen isn’t even run for OpenMP pragmas.</div><div> </div><div>Your Clang distribution needs to be compiled with OpenMP support for it to work at all.</div><div> <blockquote type="cite">On Dec 22, 2020, at 12:55 PM, Marcus Johnson <<a href="/compose?To=MarcusLJohnson1991@gmail.com">MarcusLJohnson1991@gmail.com</a>> wrote:<br> </blockquote></div><blockquote type="cite"><div><div>Why are you using such an old version of Clang?</div><div> </div><div>Clang the compiler needs to be built with support for parsing OpenMP pragmas.</div><div> </div><div>It’s not just the header and runtime you need to successfully compile with OpenMP</div><div> <blockquote type="cite">On Dec 22, 2020, at 11:57 AM, Керим Хемраев via cfe-dev <<a href="/compose?To=cfe%2ddev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br> </blockquote></div><blockquote type="cite"><div><div>Hi,</div><div> </div><div>I’m struggling with compiling simple OpenMP program with clang 5.0.0.</div><div>Here is the code (foo.cxx):</div><div> </div><div><div style="background-color:#ffffff; color:#000000; font-family:Consolas,'Courier New',monospace; font-size:14px; font-weight:normal; line-height:19px; white-space:pre"><div><span style="color: #af00db;">#include</span><span style="color: #0000ff;"> </span><span style="color: #a31515;">"omp.h"</span></div><div><span style="color: #af00db;">#include</span><span style="color: #0000ff;"> </span><span style="color: #a31515;"><stdio.h></span></div> <div><span style="color: #0000ff;">int</span><span style="color: #000000;"> </span><span style="color: #795e26;">main</span><span style="color: #000000;">(</span><span style="color: #0000ff;">void</span><span style="color: #000000;">) {</span></div><div><span style="color: #0000ff;">  </span><span style="color: #af00db;">#pragma</span><span style="color: #0000ff;"> </span><span style="color: #ff0000;">omp</span><span style="color: #0000ff;"> </span><span style="color: #ff0000;">parallel</span></div><div><span style="color: #000000;">  </span><span style="color: #795e26;">printf</span><span style="color: #000000;">(</span><span style="color: #a31515;">"thread %d</span><span style="color: #ee0000;">\n</span><span style="color: #a31515;">"</span><span style="color: #000000;">, </span><span style="color: #795e26;">omp_get_thread_num</span><span style="color: #000000;">());</span></div><div><span style="color: #000000;">}</span></div><div> </div><div><span style="font-size:15px;line-height:20px;">As I use clang as part of xeus-cling my clang installation is inside conda packages: </span></div><div><em><span style="color: #000000;">$ </span>which clang</em></div><div><em>/home/tasik/miniconda3/envs/cling/bin/clang</em></div><div> </div><div><span style="font-size:15px;line-height:20px;">As this clang package does’t have <strong>omp.h</strong> I provide additional directories to find <strong>omp.h </strong>and <strong>libomp.so</strong></span></div><div><div><span style="font-size:15px;line-height:20px;">To compile the code I use the command:</span></div><div><span style="color: #000000;"><em>$ clang -fopenmp -I/home/../usr/lib/llvm-10/include/openmp/ -L/home/../usr/lib/llvm-10/lib foo.cxx</em></span></div><div> </div></div></div></div><div>And I get errors:</div><div><strong>/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)</strong></div><div> </div><div>I really need some help to undertand how to work with clang 5.0.0 OpenMP</div><div>And I think that it is difficult to update clang’s version as xeus-cling requires mentioned 5.0.0 version...</div><div> </div><div> </div><div>With respect,</div><div>kerim</div><span>_______________________________________________</span><br><span>cfe-dev mailing list</span><br><span><a href="/compose?To=cfe%2ddev@lists.llvm.org">cfe-dev@lists.llvm.org</a></span><br><span><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></span></div></blockquote></div></blockquote></div></div></div></div></div></blockquote> <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>