为什么LD_LIBRARY_PATH不起作用?

为什么LD_LIBRARY_PATH不起作用?

我不明白为什么以下命令不起作用。LD_LIBRARY 未被全面解析。

~:$ export LD_LIBRARY_PATH=; export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/Qt5.10.0/5.10.0/gcc_64/lib; sudo /sbin/ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) |grep ^/
/sbin/ldconfig.real: Can't stat /usr/local/cuda/extras/CUPTI/lib64:/usr/local/Qt5.10.0/5.10.0/gcc_64/lib: No such file or directory
/sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/usr/lib/nvidia-384' given more than once
/sbin/ldconfig.real: Path `/usr/lib32/nvidia-384' given more than once
/sbin/ldconfig.real: Path `/usr/lib/nvidia-384' given more than once
/sbin/ldconfig.real: Path `/usr/lib32/nvidia-384' given more than once
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: /lib/i386-linux-gnu/ld-2.23.so is the dynamic linker, ignoring

/usr/local/cuda/lib64:
/opt/lib/alembic/lib:
/usr/lib/x86_64-linux-gnu/libfakeroot:
/lib/i386-linux-gnu:
/usr/lib/i386-linux-gnu:
/usr/local/lib:
/sbin/ldconfig.real: Cannot stat /usr/lib32/nvidia-384/libOpenGL.so/usr/lib/nvidia-384:
: No such file or directory/usr/lib32/nvidia-384:

/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.23.so is the dynamic linker, ignoring

/opt/lib/ocio/lib:
/opt/lib/oiio/lib:
/opt/lib/osd/lib:
/opt/lib/osl/lib:
/lib/x86_64-linux-gnu:
/usr/lib/x86_64-linux-gnu:
/sbin/ldconfig.real: /lib32:
/lib32/ld-2.23.so is the dynamic linker, ignoring

/usr/lib32:
/lib:
/usr/lib:
/usr/lib/i386-linux-gnu/sse2: (hwcap: 0x0000000004000000)
/usr/lib/nvidia-384/tls: (hwcap: 0x8000000000000000)
/usr/lib32/nvidia-384/tls: (hwcap: 0x8000000000000000)

每个目录都是正确的目录。以下命令有效。

~:$ export LD_LIBRARY_PATH=; export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64; sudo /sbin/ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) |grep ^/
/sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/usr/lib/nvidia-384' given more than once
/sbin/ldconfig.real: Path `/usr/lib32/nvidia-384' given more than once
/sbin/ldconfig.real: Path `/usr/lib/nvidia-384' given more than once
/sbin/ldconfig.real: Path `/usr/lib32/nvidia-384' given more than once
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: /lib/i386-linux-gnu/ld-2.23.so is the dynamic linker, ignoring

/usr/local/cuda/lib64:
/usr/local/cuda/extras/CUPTI/lib64:
/opt/lib/alembic/lib:
/usr/lib/x86_64-linux-gnu/libfakeroot:
/lib/i386-linux-gnu:
/usr/lib/i386-linux-gnu:
/usr/local/lib:
/sbin/ldconfig.real: Cannot stat /usr/lib32/nvidia-384/libOpenGL.so: No such file or directory/usr/lib/nvidia-384:

/usr/lib32/nvidia-384:
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.23.so is the dynamic linker, ignoring

/opt/lib/ocio/lib:
/opt/lib/oiio/lib:
/opt/lib/osd/lib:
/opt/lib/osl/lib:
/lib/x86_64-linux-gnu:
/usr/lib/x86_64-linux-gnu:
/sbin/ldconfig.real: /lib32/ld-2.23.so is the dynamic linker, ignoring
/lib32:

/usr/lib32:
/lib:
/usr/lib:
/usr/lib/i386-linux-gnu/sse2: (hwcap: 0x0000000004000000)
/usr/lib/nvidia-384/tls: (hwcap: 0x8000000000000000)
/usr/lib32/nvidia-384/tls: (hwcap: 0x8000000000000000)

我正在使用 ubuntu 16.04。谁知道原因?

谢谢。

~:$ ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu10) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

相关内容