<div dir="ltr"><div class="">
<div class="">
<p>Hi</p>
<p>I have successfully cross compiled libiomp5.so for ARM using clang
and arm-linux-gnueabihf toolchain. Then I cross compiled a simple openmp
program with libiomp5.so. But when I tried to run the program on ARM, I
got a problem. The program is:</p>
<p>#include <stdio.h><br>
#include <stdlib.h><br>
#include <omp.h><br>
int main(int argc, char** argv)<br>
{<br>
int i = 0;<br>
#pragma omp parallel for<br>
for(i = 0; i < 10; i++) {<br>
int tid = omp_get_thread_num();<br>
printf("hello from thread %d\n", tid);<br>
}<br>
return 0;<br>
}</p>
<p>The output is:</p>
<p>hello from thread 0<br>
hello from thread 0<br>
hello from thread 2<br>
hello from thread 2<br>
hello from thread 1<br>
hello from thread 1<br>
hello from thread 3<br>
hello from thread 3<br>
hello from thread 4<br>
hello from thread 4<br>
pthread_mutex_lock.c:80: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.<br>
Aborted</p>
<p>Can someone provide some help?</p>
<p>Thanks!</p>
<p>Xiaokang</p>
</div>
</div></div>