Cannot install rgdal package in R on RHEL6, unable to load shared object rgdal.so

ぐ巨炮叔叔 提交于 2019-12-08 02:15:11

问题


I have AWS RHEL6 server where I've installed (compiled) rgdal 1.9.2 and proj packages. Now in R I want to install rgdal package but it gives this error:

** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/Roel/R/x86_64-redhat-linux-gnu-library/3.3/rgdal/libs/rgdal.so':
libgdal.so.1: cannot open shared object file: No such file or directory Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/Roel/R/x86_64-redhat-linux-gnu-library/3.3/rgdal’ Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status

Full install log can be found here.

When I do locate rgdal.so in Linux it doesn't find anything. I can also not find how to get rgdal.so of what it is part of.

Has anyone any idea on how to fix this?


回答1:


I fixed it:

There is an error further up in the log as well that I had missed because of the error at the end:

./proj_conf_test: error while loading shared libraries: libgdal.so.1: cannot open shared object file: No such file or directory

libgdal.so.1 was on the system in /usr/local/lib.

I then did:

echo "/usr/local/lib" >> /etc/ld.so.conf.d/R-dependencies-x86_64.conf
ldconfig

This fixed the subsequent error that I mentioned in the OP.




回答2:


If you see Permission Denied when running Roel's, try:

sudo ldconfig -c "echo '/usr/local/lib' >> /etc/ld.so.conf.d/R-dependencies-x86_64.conf"


来源:https://stackoverflow.com/questions/40305095/cannot-install-rgdal-package-in-r-on-rhel6-unable-to-load-shared-object-rgdal-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!