虽然我使用 ldconfig 和 /etc/ld.so.conf.d/lib.conf 但找不到库
library not found although I use ldconfig and /etc/ld.so.conf.d/lib.conf
我正在使用 Fedora 25。
我有一个需要多个库的二进制文件。二进制文件找不到 libRblas.so
:
$ ldd XPore-Engine | less | grep not
libvtkRenderingAnnotation.so.1 => /usr/lib64/vtk/libvtkRenderingAnnotation.so.1 (0x00007fac12563000)
libRblas.so => not found
libRblas.so => not found
libRblas.so => not found
库路径已正确配置 .conf
文件:
$ cat /etc/ld.so.conf.d/R-x86_64.conf
/usr/lib64/R/lib
$ ll /usr/lib64/R/lib
lrwxrwxrwx. 1 root root 11 dic 16 20:46 libopenblas.so.0 -> libRblas.so
lrwxrwxrwx. 1 root root 27 oct 31 21:16 libRblas.so -> /usr/lib64/libopenblas.so.0
-rwxr-xr-x. 1 root root 1989312 oct 31 21:16 libRlapack.so
-rwxr-xr-x. 1 root root 178856 oct 31 21:16 libRrefblas.so
-rwxr-xr-x. 1 root root 2911536 oct 31 21:16 libR.so
然后我使用 ldconfig
:
加载配置
$ ldconfig -v | grep libRblas
libopenblas.so.0 -> libRblas.so
然而,在再次执行 ldd
之后,它 returns 相同的输出表明 libRblas.so
没有找到。
我该如何解决这个问题?
我在 https://bugzilla.redhat.com/show_bug.cgi?id=1404662 的 Read Hat Bugzilla 错误跟踪系统中找到了 Tom 提供的解决方法。
Yeah, so it looks like while R is perfectly happy using libRblas.so as a > symlink to libopenblas.so.0, externally, nothing else is.
The speedup from using openblas is significant, so the fix is to build a copy of openblas that has the libRblas.so filename and soname, and use that instead of the symlink. I have a new build of openblas going which adds this, then I'll do a new round of R builds that depend on it.
As a temporary workaround, you can run (as root):
rm -f /usr/lib64/R/lib/libRblas.so
mv /usr/lib64/R/lib/libRrefblas.so /usr/lib64/R/lib/libRblas.so
That will restore the unoptimized libRblas.so that R provides.
Oh, and run /sbin/ldconfig (as root) after moving libRrefblas.so so that the ldcache is updated.
我正在使用 Fedora 25。
我有一个需要多个库的二进制文件。二进制文件找不到 libRblas.so
:
$ ldd XPore-Engine | less | grep not
libvtkRenderingAnnotation.so.1 => /usr/lib64/vtk/libvtkRenderingAnnotation.so.1 (0x00007fac12563000)
libRblas.so => not found
libRblas.so => not found
libRblas.so => not found
库路径已正确配置 .conf
文件:
$ cat /etc/ld.so.conf.d/R-x86_64.conf
/usr/lib64/R/lib
$ ll /usr/lib64/R/lib
lrwxrwxrwx. 1 root root 11 dic 16 20:46 libopenblas.so.0 -> libRblas.so
lrwxrwxrwx. 1 root root 27 oct 31 21:16 libRblas.so -> /usr/lib64/libopenblas.so.0
-rwxr-xr-x. 1 root root 1989312 oct 31 21:16 libRlapack.so
-rwxr-xr-x. 1 root root 178856 oct 31 21:16 libRrefblas.so
-rwxr-xr-x. 1 root root 2911536 oct 31 21:16 libR.so
然后我使用 ldconfig
:
$ ldconfig -v | grep libRblas
libopenblas.so.0 -> libRblas.so
然而,在再次执行 ldd
之后,它 returns 相同的输出表明 libRblas.so
没有找到。
我该如何解决这个问题?
我在 https://bugzilla.redhat.com/show_bug.cgi?id=1404662 的 Read Hat Bugzilla 错误跟踪系统中找到了 Tom 提供的解决方法。
Yeah, so it looks like while R is perfectly happy using libRblas.so as a > symlink to libopenblas.so.0, externally, nothing else is. The speedup from using openblas is significant, so the fix is to build a copy of openblas that has the libRblas.so filename and soname, and use that instead of the symlink. I have a new build of openblas going which adds this, then I'll do a new round of R builds that depend on it.
As a temporary workaround, you can run (as root): rm -f /usr/lib64/R/lib/libRblas.so mv /usr/lib64/R/lib/libRrefblas.so /usr/lib64/R/lib/libRblas.so
That will restore the unoptimized libRblas.so that R provides.
Oh, and run /sbin/ldconfig (as root) after moving libRrefblas.so so that the ldcache is updated.