I've installed R 3.5.3 as described here. I then install Rstudio from the source. I run Rstudio from the Ubuntu launcher. Then when I try to install certain packages, it gives me this error:
libRlapack.so: cannot open shared object file: No such file or directory
After a lucky Google find, I came across this solution to fix the issue:
- Find where
libRlapack.so
is on your system:locate libRlapack.so
. - Create a symlink to
/usr/lib/libRlapack.so
withsudo ln -s /usr/lib/R/modules/lapack.so /usr/lib/libRlapack.so
Then you will get an error like so:
libRblas.so: cannot open shared object file: No such file or directory
and a similar process with locate libblas.so
and linking it fixes the issue, and Rstudio seems to work ok. (sudo ln -s /usr/lib/x86_64-linux-gnu/libblas.so /usr/lib/libRblas.so
)
The other weird thing is running Rstudio from the command line didn't show the same issues...things installed and loaded fine. But then running Rstudio from the launcher wouldn't work.
So what is it about running Rstudio from the launcher that causes it not be able to find certain files? Is it a ~/.profile
vs ~/.bashrc
issue, or some other environment variable issue?
Obviously the linking worked ok in this case, but I'm wondering if there's a better way that these files (libRlapack.so
, libRblas.so
) should be installed in Ubuntu, or some environment variable(s) that should usually be set to avoid issues. I've had similar problems with Rstudio not being able to find other files (e.g. openssl files) as well in the past.