openmp runs single threaded


i am trying to use clang with openmp support on a mac (10.9).
i have tried compiling from 3.7.1 sources (using instruciton at and prebuld 3.7.0 binaries for maces/darwin (from with the same result:
the compiler handles the #pragma omp directive without complaining, the resulting binary is linked against libomp as excepted, but it runs single threaded, no matters the method i try to set num_threads (num_threads directive, OMP_NUM_THREADS env, omp_set_num_threads call, etc.)
omp_get_num_procs and omp_get_max_threads both return 4 on my machine.
the code is a basic hello parallel world program …

any hints ?
more details, and the code are in this stackoverflow question:



Hi Renaud,

Try to use -fopenmp=libomp. This is already fixed in trunk, but not in 3.7.


thanks, that was it!