I installed gcc/g++ by anaconda, because the g++ in the system dismatch with cuda 11.3. Therefore I installed g++9.
However, when I want to compile cuda/c++ code by g++, g++ can not find some libraries like:
/home/anaconda3/envs/gof/compiler_compat/ld: cannot find /lib64/libc.so.6: No such file or directory
/home/anaconda3/envs/gof/compiler_compat/ld: cannot find /usr/lib64/libc_nonshared.a: No such file or directory
/home/anaconda3/envs/gof/compiler_compat/ld: cannot find /lib64/librt.so.1: No such file or directory
How to solve this problem?
I tried to find the library. they are in the virtual environment of anaconda I created:
sudo find / -name libc.so.6
/home/anaconda3/envs/gof/x86_64-conda-linux-gnu/sysroot/lib64/libc.so.6
/snap/snapd/21759/lib/x86_64-linux-gnu/libc.so.6
/snap/snapd/21465/lib/x86_64-linux-gnu/libc.so.6
/snap/core22/1122/usr/lib/i386-linux-gnu/libc.so.6
/snap/core22/1122/usr/lib/x86_64-linux-gnu/libc.so.6
/snap/core22/1380/usr/lib/i386-linux-gnu/libc.so.6
/snap/core22/1380/usr/lib/x86_64-linux-gnu/libc.so.6
/snap/core20/2318/usr/lib/i386-linux-gnu/libc.so.6
/snap/core20/2318/usr/lib/x86_64-linux-gnu/libc.so.6
/snap/core20/2264/usr/lib/i386-linux-gnu/libc.so.6
/snap/core20/2264/usr/lib/x86_64-linux-gnu/libc.so.6
/snap/core18/2812/lib/i386-linux-gnu/libc.so.6
/snap/core18/2812/lib/x86_64-linux-gnu/libc.so.6
/snap/core18/2823/lib/i386-linux-gnu/libc.so.6
/snap/core18/2823/lib/x86_64-linux-gnu/libc.so.6
/usr/libx32/libc.so.6
/usr/lib32/libc.so.6
/usr/lib/x86_64-linux-gnu/libc.so.6
/usr/lib/i386-linux-gnu/libc.so.6
they are in the ‘gof’ environment, but g++ can not find it. Therefore, how could I add the environment variable to g++?
I know that I could also use ‘ln -s’ to link ‘/home/anaconda3/envs/gof/x86_64-conda-linux-gnu/sysroot/lib64/libc.so.6’ and ‘/lib64/libc.so.6’, but there are too many libs can not be found.
logic chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.