mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Solving the Pthreads issue


From: Tony Theodore
Subject: Re: [Mingw-cross-env-list] Solving the Pthreads issue
Date: Sun, 9 May 2010 23:06:31 +1000

On 9 May 2010 20:05, Volker Grabsch <address@hidden> wrote:
> Tony Theodore <address@hidden> schrieb:
>> On 8 May 2010 00:59, Gregory Smith <address@hidden> wrote:
>> >
>> > I asked about OpenMP and would be happy to write a simple test program. I
>> > may not get to it right away, though. Also, I do not understand the static
>> > pthread deadlock in detail, so I'm not sure how helpful that test program
>> > will be. If you just want to test that OpenMP is operable, I can do that.
>>
>> I found this snippet at the OpenMP site[1]:
>>
>> #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());
>> }
>
> Nice!
>
>> It compiles and runs in Linux with:
>>
>> gcc -fopenmp hello.c -o hello.exe -lgomp -lpthread -static
>>
>> The same using the cross-gcc compiles but doesn't run in Windows, and
>> there's no sensible error message.
>
> What do you get if you run it under Wine?
>
> Do you see the "err:ntdll:RtlpWaitForCriticalSection" messages
> that I mentioned at the beginning of this thread?

Yes, I just installed wine and that's the error.

> And what about the "-static" option? Is it really needed to
> compile the test program? What happens if you remove it?

Actually, those options do nothing, just compiling with :

i686-pc-mingw32-gcc -fopenmp hello.c -o hello.exe

achieves the same result.

Tony




reply via email to

[Prev in Thread] Current Thread [Next in Thread]