LD_LIBRARY_PATH的优越性和编译麻烦 [英] LD_LIBRARY_PATH precendence and trouble with compiling

查看:199
本文介绍了LD_LIBRARY_PATH的优越性和编译麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Linux机器上安装一些软件(如果需要的话,特别是python的rpy2软件包,尤其是rpy2.robjects).我需要该软件在我的本地空间而不是像/usr/lib64这样的全局空间中寻找其共享库.我在这台机器上没有管理员权限.我的问题是,即使我将LD_LIBRARY_PATH设置为指向我的本地空间,该软件仍然会转到/usr/lib64/whatever,在那里它会查找过时的库.这些库缺少它需要的某些对象,因此失败.有什么可能优先于LD_LIBRARY_PATH,有没有办法改变/摆脱它?谢谢.

I am trying to install some software on a Linux machine (python's rpy2 package, rpy2.robjects in particular, if it matters). I need the software to look for its shared libraries in my local space, not in the global spaces like /usr/lib64 whatever. I do not have admin privileges on this machine. My problem is that even though I set LD_LIBRARY_PATH to point to my local space, the software still goes to the /usr/lib64/whatever, where it finds libraries that are out of date. These libraries are missing some objects it needs, so it fails. What could be taking precedence over LD_LIBRARY_PATH, and is there a way to change/get rid of it? Thanks.

顺便说一句,这个站点上的某人一年前或更早就遇到了类似的问题,但是他的答案涉及到env变量RPATH,并使用chrpath实用程序对其进行了更改.对我来说,还不清楚rpy2是否正在使用RPATH,并且chrpath在我的系统上似乎不可用.

BTW, someone on this site had a similar question a year or more ago, but his answer involved the env variable RPATH, and changing it with the chrpath utility. It is not clear to me at all that rpy2 is using RPATH, and chrpath seems unavailable on my system.

附录:我尝试使用LD_DEBUG = libs运行.得到了很多输出,好像系统正在我的LD_LIBRARY_PATH中寻找这些库并找到它们.这似乎是麻烦开始的地方:

Addendum: I tried running with LD_DEBUG=libs. Got alot of output that looks like the system is looking for the libs in my LD_LIBRARY_PATH and finding them. Here is where the trouble seems to start:

/usr/local/lib64/R/library/methods/libs/methods.so: error: symbol lookup error:
undefined symbol: Rf_allocS4Object (fatal)
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
unable to load shared object '/usr/local/lib64/R/library/methods/libs/methods.so':
/usr/local/lib64/R/library/methods/libs/methods.so: undefined symbol: Rf_allocS4Object

所以我的猜测是,问题在于DLLpath中的内容将覆盖LD_LIBRARY_PATH.我试图通过在目录前面添加os.environ ['PATH']来更改此设置,但是没有做.显然没有"DLLPATH",就像我想的那样.

So my guess is that the trouble is that whatever is in DLLpath is overriding LD_LIBRARY_PATH. I have tried to change this by prepending my directories to os.environ['PATH'], but no do. There is apparently no "DLLPATH", as I thought there would be.

好的,我想这是进步.还有其他吗?谢谢.

OK, that's progress, I guess. Anybody have anything else? Thanks.

推荐答案

如果仍然有人在读这篇文章,我会从事一些人事工程"来解决问题,即让系统管理员重新安装R,以便它能够正常运行.拥有我需要的一切.他们当然很好.非常感谢所有提出建议的人.想继续进行其中的一些工作,但是我必须忙于这个项目.非常有义务!

If anyone is still reading this, I engaged in some "personnel engineering" to solve the problem, i.e. got the system admins to re-install R so that it had everything I needed. Was certainly nice of them. Thanks very much to everyone who gave suggestions. Would like to keep going on some of them, but I've got to get busy on this project. Much obliged!

这篇关于LD_LIBRARY_PATH的优越性和编译麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆