Build failure: papi_avail not linked with -lpthread

Issue #71 resolved
Edvard Fagerholm created an issue

The following currently doesn’t work:

./configure --with-static-lib=yes --with-static-tools && make

The build fails with

make[2]: Entering directory `/home/efagerho/git/papi/src/utils'
gcc -o papi_avail papi_avail.o print_header.o ../libpapi.a -ldl -static
../libpapi.a(papi_hl.o): In function `_internal_hl_library_init':
/home/efagerho/git/papi/src/high-level/papi_hl.c:218: undefined reference to `pthread_self'
../libpapi.a(papi.o): In function `_internal_papi_init':
/home/efagerho/git/papi/src/papi.c:92: undefined reference to `pthread_self'
collect2: error: ld returned 1 exit status
make[2]: *** [papi_avail] Error 1
make[2]: Leaving directory `/home/efagerho/git/papi/src/utils'
make[1]: *** [utils] Error 2
make[1]: Leaving directory `/home/efagerho/git/papi/src'
make: *** [libpfm4/lib/libpfm.a] Error 2

One clearly sees that gcc is not being given the -lpthread flag.

Comments (2)

  1. Log in to comment