openmp ith llvm

Dear all,

I’m trying to get openmp to work with llvm, either with static compiler or with jit, however with no success.

I’ve followed this:

LLVM Project Blog: OpenMP Support
OpenMP support in Clang compiler is completed! Every pragma and clause from 3.1 version of the standard is supported in full, including combined directives (like ‘# …
Read more…

  • | - |

In case of static compilation, I always get 1 thread.

In case of jit, I get this error:

LLVM ERROR: Program used external function ‘omp_set_num_threads’ which could not be resolved!

However, my code works just fine with g++.

Any help is appreciated.

I think the default is still the old gomp mode, so you have to
explicitly ask at configure time (i.e. --with-clang-default-openmp-runtime=libomp)
or with -fopenmp=libomp.


Hi Marwa,

I had similar problems. Take a look at this SO thread:

Best regards,