Linking error with gcc on ppc64le

Hi all

I am trying to test extensively libomp on ppc platforms. When compiling on ppc64le (a P8 node) using gcc 4.8.2 both application and runtime library, I get the following:

testiompppc64.o: In function main': testiompppc64.cpp:(.text+0x154): undefined reference to GOMP_parallel_start’
testiompppc64.cpp:(.text+0x168): undefined reference to GOMP_parallel_end' testiompppc64.o: In function main._omp_fn.0’:
testiompppc64.cpp:(.text+0x334): undefined reference to omp_get_thread_num' testiompppc64.cpp:(.text+0x354): undefined reference to omp_get_num_threads’
testiompppc64.cpp:(.text+0x364): undefined reference to `omp_get_thread_num’

Inspection of libomp.so shows the following when grepping against omp_get_num_threads symbol:

000000000005bd40 t __kmp_api_omp_get_num_threads
000000000005d8a0 t _kmp_api_omp_get_num_threads
000000000005d8a0 t __kmp_api_omp_get_num_threads__10_alias
000000000005bd40 t kmp_api_omp_get_num_threads_10_alias
000000000005d8a0 T omp_get_num_threads
@OMP_1.0
000000000005bd40 T omp_get_num_threads@OMP_1.0
000000000005d8a0 T omp_get_num_threads
@@VERSION
000000000005bd40 T omp_get_num_threads@@VERSION

This seems to be happening only when using gcc to build the application. If I use clang to build the application, then everything is fine even when building the library with either clang or gcc.
In these successful cases, when checking the symbols used I obtain:

  1. The executable:

U omp_get_thread_num@@VERSION

  1. The library (in this case I used gcc to build it):

000000000005cde0 T omp_get_thread_num_@@VERSION
000000000005b610 T omp_get_thread_num@@VERSION

It may be that my gcc installation is not appropriate for the platform and what I am trying to do, but is anyone aware of what kind of problem this could be and point me in the direction of a solution?

Thanks!

– Carlo