I got the similar error:
/home/sfchen/anaconda3/envs/dlpy2/compiler_compat/ld: cannot find -lpthread
/home/sfchen/anaconda3/envs/dlpy2/compiler_compat/ld: cannot find -lc
and solved by follow steps.
- find the root of the lib (e.g. lpthread)
ld -lpthread --verbose
output like this:
attempt to open //usr/local/lib/x86_64-linux-gnu/libpthread.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libpthread.a failed
attempt to open //lib/x86_64-linux-gnu/libpthread.so failed
attempt to open //lib/x86_64-linux-gnu/libpthread.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libpthread.so succeeded
opened script file //usr/lib/x86_64-linux-gnu/libpthread.so
opened script file //usr/lib/x86_64-linux-gnu/libpthread.so
attempt to open /lib/x86_64-linux-gnu/libpthread.so.0 succeeded
/lib/x86_64-linux-gnu/libpthread.so.0
attempt to open /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a succeeded
libc.so.6 needed by /lib/x86_64-linux-gnu/libpthread.so.0
found libc.so.6 at //lib/x86_64-linux-gnu/libc.so.6
ld-linux-x86-64.so.2 needed by /lib/x86_64-linux-gnu/libpthread.so.0
found ld-linux-x86-64.so.2 at //lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
ld: warning: cannot find entry symbol _start; not setting start address
- From the 5th line above
attempt to open //usr/lib/x86_64-linux-gnu/libpthread.so succeeded
get the path1 = /usr/lib/x86_64-linux-gnu/libpthread.so
- From the error message:
/home/sfchen/anaconda3/envs/dlpy2/compiler_compat/ld: cannot find -lpthread
get the path2 = /home/sfchen/anaconda3/envs/dlpy2/compiler_compat/
Last, input like this :
ln -s path1 path2
Specifically,
ln -s /usr/lib/x86_64-linux-gnu/libpthread.so /home/sfchen/anaconda3/envs/dlpy2/compiler_compat/
that's all, hope it may be helpful!