troubles with pthread

Howdy, I didn’t change anything, I swear :) Suddenly, my PGI 5.2-4 installation on RHEL3 AS Update4 starting throwing nasty errors relating to pthread. For instance,

./mymodel: relocation error:
/usr/local/pgi-5.2-4/linux86/5.2/lib/ symbol _errno,
version GLIBC_2.0 not defined in file with link time reference

So I googled around, and it was suggested somewhere to change the /lib/ link. I did such and now I am getting this error:

/usr/local/pgi-5.2-4/linux86/5.2/lib/ undefined reference to
errno@GLIBC_PRIVATE' /usr/local/pgi-5.2-4/linux86/5.2/lib/ undefined reference to __libc_dl_error_tsd@GLIBC_PRIVATE’
/usr/local/pgi-5.2-4/linux86/5.2/lib/ undefined reference to
__resp@GLIBC_PRIVATE' /usr/local/pgi-5.2-4/linux86/5.2/lib/ undefined reference to h_errno@GLIBC_PRIVATE’

Ugh, I am about worthless trying to figure this out :(

ls -l /usr/local/pgi-5.2-4/linux86/5.2/lib/

lrwxrwxrwx 1 root root 20 Nov 18 14:44 /usr/local/pgi-5.2-4/linux86/5.2/lib/ -> /lib/

ls -l /lib/libpthread*

-rwxr-xr-x 1 root root 103948 Oct 22 04:01 /lib/
-rwxr-xr-x 1 root root 97712 Jan 24 21:01 /lib/
lrwxrwxrwx 1 root root 18 Jan 24 21:02 /lib/ ->

ls -l /usr/lib/libpthread*

-rw-r–r-- 1 root root 137008 Oct 22 03:04 /usr/lib/libpthread.a
-rw-r–r-- 1 root root 1052 Oct 22 03:04 /usr/lib/libpthread_nonshared.a
-rw-r–r-- 1 root root 216 Oct 22 02:54 /usr/lib/


Except on Red Hat 7.3, “libpgthread” is just a link to your system’s “libpthread” library. Notice that on 1/24/05 someone has added “” to your system and updated the link. My guess this new pthreads library has an incompatability. Reset the link back to “” and see if it compiles. You also might try compiling with “-lpgmp -lpthreads” to see if the problem is that the new pthreads library uses “libpthread_nonshared” whcih can also cause problems.

  • Mat


Thanks for your comments. I wasn’t explicit in the email that I changed that libpthread link in /lib. I found a suggestion on the internet to do that. In fact, when I do, the debugger works. When I change back, it doesn’t (with the error above) and the same errors appear for the model code.

I will try the other compile options. Strange thing is that this was working fine up until a few weeks ago. One of RedHat’s updates must have caused trouble.