2

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?

J_F
  • 9,956
  • 2
  • 31
  • 55
  • 1
    read this one? http://stackoverflow.com/questions/15248815/rgdal-package-installation – J_F Oct 28 '16 at 12:32
  • Yes, I had this problem before this one but managed to solve it. – Roel Esselink Oct 28 '16 at 12:54
  • For me the exact error, during install of `rgdal` was `unable to load shared object '/home//R/x86_64-redhat-linux-gnu-library/3.3/rgdal/libs/rgdal.so':` followed by `libgdal.so.20: cannot open shared object file: No such file or directory`. The answer from @RoelEsselink's was the solution. – geneorama Jun 13 '17 at 14:51

2 Answers2

6

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.

4

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"
Pang
  • 9,564
  • 146
  • 81
  • 122
user3342735
  • 424
  • 1
  • 5
  • 14