<div dir="ltr"><div class="gmail_quote">On Fri, May 29, 2015 at 11:40 AM İsmail Dönmez <<a href="mailto:ismail@donmez.ws">ismail@donmez.ws</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, May 29, 2015 at 9:32 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:<br>
> On Fri, May 29, 2015 at 5:56 AM, İsmail Dönmez <<a href="mailto:ismail@donmez.ws" target="_blank">ismail@donmez.ws</a>> wrote:<br>
>><br>
>> On Thu, May 28, 2015 at 11:48 PM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>><br>
>> wrote:<br>
>> > On Thu, May 28, 2015 at 5:09 AM İsmail Dönmez <<a href="mailto:ismail@donmez.ws" target="_blank">ismail@donmez.ws</a>> wrote:<br>
>> >><br>
>> >> Hi,<br>
>> >><br>
>> >> On Thu, May 28, 2015 at 4:52 AM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > Author: chandlerc<br>
>> >> > Date: Wed May 27 20:52:38 2015<br>
>> >> > New Revision: 238389<br>
>> >> ><br>
>> >> > URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D238389-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=QGiRu2h1ttlP56n7L4ONu65kBvjcklKlFxcXbbA2leo&s=GnSHEApTgCpoPxWO4UupF4MzjHdTQ2V_VywfiSgciiA&e=" target="_blank">http://llvm.org/viewvc/llvm-project?rev=238389&view=rev</a><br>
>> >> > Log:<br>
>> >> > [omp] Re-work Clang's handling of -fopenmp and undo r237769.<br>
>> >><br>
>> >><br>
>> >> This seems to break openmp tests with<br>
>> >> -DCLANG_DEFAULT_OPENMP_RUNTIME=libiomp5 see:<br>
>> ><br>
>> ><br>
>> > Yea, I wanted to have test coverage of the default, but it doesn't work<br>
>> > well<br>
>> > when the default is overridden.<br>
>> ><br>
>> > I looked into how to actually have test coverage of the default and<br>
>> > track<br>
>> > which default was selected, but its really hard and complex. Yuck.<br>
>> ><br>
>> > I'll look for a way to get at least *some* coverage of the default<br>
>> > without<br>
>> > making it break folks that are overriding it. Sorry for the trouble.<br>
>><br>
>> Tests pass now but there is still one grave problem. With<br>
>> CLANG_DEFAULT_OPENMP_RUNTIME=libiomp5 if you do:<br>
>><br>
>> λ clang -fopenmp=libgomp omp_hello.c<br>
>> λ ./a.out<br>
>> Hello World from thread = 0<br>
>> Number of threads = 1<br>
>><br>
>> No OpenMP, lets go back to defaults:<br>
>><br>
>> λ clang -fopenmp=libiomp5 omp_hello.c<br>
>> λ ./a.out<br>
>> Hello World from thread = 0<br>
>> Hello World from thread = 4<br>
>> Hello World from thread = 3<br>
>> Hello World from thread = 2<br>
>> Hello World from thread = 6<br>
>> Hello World from thread = 1<br>
>> Hello World from thread = 5<br>
>> Hello World from thread = 7<br>
>> Number of threads = 8<br>
><br>
><br>
> OK, and what's the one grave problem?<br>
<br>
tl;dr clang -fopenmp=libgomp compiles and links to libgomp but doesn't<br>
enable OpenMP.<br></blockquote><div><br></div><div>I think that is actually the best behavior we can provide.</div><div><br></div><div>Clang doesn't support emitting code compatible with libgomp. There is currently no support for actually enabling OpenMP in Clang and using libgomp.</div></div></div>