[Openmp-dev] issue with opennp and clang

Amir H. Ashouri amirhossein.ashouri at gmail.com
Wed Nov 12 09:19:15 PST 2014


Thanks all for their responses. I re-compile the clang with OpenMP support
and the library files and set the library paths and it worked finally. I
might think as Alexey mentioned, that the CentOS was using the default
clang to that matter before head.

Regards,

-Amir

On Wed, Nov 12, 2014 at 11:55 AM, Jack Howarth <
howarth.mailing.lists at gmail.com> wrote:

> Amir,
>     You didn't say what platform you are trying to use clang-omp on. If it
> is OS X, the llvm34-3.4.2-2 fink package (http://finkproject.org) has a
> port of the clang-omp changes at commit
> 13e28835a005b44481387a32666ed39a7db58eb6 over the llvm 3.4.2 release. While
> the fink llvm35 packaging isn't released yet, you can obtain the necessary
> llvm35* packaging files to build it from
> http://fink.cvs.sourceforge.net/viewvc/fink/experimental/fangism/finkinfo/.
> This has a port of the clang-omp changes at commit 3f687cbc520a8b8f506d7941f0cebd6c5af1cef6 over
> llvm 3.5.0 with the openmp trunk changes at r219214.
>              Jack
>
> On Fri, Nov 7, 2014 at 3:22 PM, Amir H. Ashouri <
> amirhossein.ashouri at gmail.com> wrote:
>
>> I did that.
>>
>> Downloaded and compiled with gcc, then export all the PATHs. Otherwise,
>> It would have given me compile error because the "omp.h" is different here.
>>
>> -Amir
>>
>> On Fri, Nov 7, 2014 at 3:13 PM, Millad Ghane <millad.mg at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> You haven't imported the openmp library to Clang yet. It simply ignores
>>> the pragmas.
>>>
>>> Go to this link and follow the instructions.
>>> clang-omp.github.io
>>>
>>>
>>> Best Regards,
>>> Millad
>>>
>>>
>>> On Friday, November 7, 2014, Amir H. Ashouri <
>>> amirhossein.ashouri at gmail.com> wrote:
>>>
>>>> Greetings,
>>>>
>>>> so I tried to use opennp with one of the latest version of clang, clang
>>>> version 3.4.2 (tags/RELEASE_34/dot2-final). Followed the procedure to
>>>> compilre and export the library PATHs, Compiling my hello.c using :
>>>>
>>>> clang -fopenmp hello.c
>>>>
>>>> and then running it, still it can't use more than 1 thread:
>>>>
>>>> Bash-4.1$ ./a.out Hello from thread 0, nthreads 1
>>>>
>>>> I tried to manually export export OMP_NUM_THREADS=8 but that didn't
>>>> solve anything as well, As a workaround I define  #pragma omp parallel
>>>> num_threads(#noofthreads) inside the source code but still the issue
>>>> is there.
>>>>
>>>> Any suggestions would be appreciated.
>>>>
>>>>
>>>> -Amir
>>>>
>>>>
>>>> p.sl: This is the hello.c:
>>>>
>>>> #include <omp.h>#include <stdio.h>int main() {#pragma omp parallel
>>>> printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads
>>>>
>>>>
>>>
>>> --
>>> Sent from my iPhone
>>>
>>
>>
>> _______________________________________________
>> Openmp-dev mailing list
>> Openmp-dev at dcs-maillist2.engr.illinois.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20141112/4c542810/attachment.html>


More information about the Openmp-dev mailing list