Rolf Turner
2018-Aug-23 10:57 UTC
[R] R shared library (/usr/lib64/R/lib/libR.so) not found.
I *think* that this is an R question (and *not* an RStudio question!) I have, somewhat against my better judgement, decided to experiment with using RStudio. I downloaded and install RStudio. Easy-peasy. Nice lucid instructions. Then I tried to start RStudio ("rstudio" from the command line) and got a pop-up window with the error message:> R shared library (/usr/lib64/R/lib/libR.so) not found. If this > is a custom build of R, was it built with the --enable-R-shlib option?Oops, no, I guess it wasn't. So I carefully did a sudo make uninstall make clean make distclean and then did ./R-3.5.1/configure <various flags> making sure I added the --enable-R-shlib flag. Then I did make and sudo make install. It all seemed to go ... but then I did rstudio again and got the same popup error. There is indeed *no* libR.so in /usr/lib64/R/lib. There *is* a libR.so in /usr/lib/R/lib, but (weirdly) ls -l reveals that it dates from the my previous install of R-3.5.1 for which I *did not* configure with --enable-R-shlib. Can anyone explain to me WTF is going on? What should I do? Just make a symbolic link from /usr/lib/R/lib/libR.so to /usr/lib64/R/lib/libR.so? It bothers me that /usr/lib/R/lib/libR.so was not "refreshed" from my most recent install of R. I plead for enlightenment. cheers, Rolf Turner P.S. I'm running Ubuntu 18.04. And the previous install of R was done under Ubuntu 18.04. R. T. -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276
Jan T Kim
2018-Aug-23 11:09 UTC
[R] R shared library (/usr/lib64/R/lib/libR.so) not found.
Hi Rolf & All, I haven't built R in a while, but my general expectation of an autotools based build & install would be that the default prefix is /usr/local, rather than /usr. So I'd expect the shared libs in /usr/local/lib, /usr/local/lib64 etc. I also have a recollection that I once installed Rstudio for some MOOC, and ended up putting a symlink in somewhere like /usr/lib* , because Rstudio was only available as a binary with the location of the shared lib hard-baked into it. Depending on your <various flags> this may be irrelevant, apologies in that case. Best regards, Jan On Thu, Aug 23, 2018 at 10:57:35PM +1200, Rolf Turner wrote:> > I *think* that this is an R question (and *not* an RStudio question!) > > I have, somewhat against my better judgement, decided to experiment with > using RStudio. > > I downloaded and install RStudio. Easy-peasy. Nice lucid instructions. > > Then I tried to start RStudio ("rstudio" from the command line) > and got a pop-up window with the error message: > > >R shared library (/usr/lib64/R/lib/libR.so) not found. If this > >is a custom build of R, was it built with the --enable-R-shlib option? > > Oops, no, I guess it wasn't. So I carefully did a > > sudo make uninstall > make clean > make distclean > > and then did > > ./R-3.5.1/configure <various flags> > > making sure I added the --enable-R-shlib flag. > > Then I did make and sudo make install. It all seemed to go ... > but then I did > > rstudio > > again and got the same popup error. > > There is indeed *no* libR.so in /usr/lib64/R/lib. > > There *is* a libR.so in /usr/lib/R/lib, but (weirdly) ls -l reveals that it > dates from the my previous install of R-3.5.1 for which I *did not* > configure with --enable-R-shlib. > > Can anyone explain to me WTF is going on? > > What should I do? Just make a symbolic link from /usr/lib/R/lib/libR.so to > /usr/lib64/R/lib/libR.so? > > It bothers me that /usr/lib/R/lib/libR.so was not "refreshed" from my > most recent install of R. > > I plead for enlightenment. > > cheers, > > Rolf Turner > > P.S. I'm running Ubuntu 18.04. And the previous install of R was done under > Ubuntu 18.04. > > R. T. > > -- > Technical Editor ANZJS > Department of Statistics > University of Auckland > Phone: +64-9-373-7599 ext. 88276 > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Rolf Turner
2018-Aug-23 11:34 UTC
[R] R shared library (/usr/lib64/R/lib/libR.so) not found.
On 08/23/2018 11:09 PM, Jan T Kim via R-help wrote:> Hi Rolf & All, > > I haven't built R in a while, but my general expectation of an > autotools based build & install would be that the default prefix > is /usr/local, rather than /usr. So I'd expect the shared libs > in /usr/local/lib, /usr/local/lib64 etc.I guess I should have said --- I did sudo make prefix=/usr install which puts stuff into /usr rather than into /usr/local. I forget exactly why I chose (in the dim distant past) to do this ... I have a vague recollection that my search path was more "comfortable" that way.> I also have a recollection that I once installed Rstudio for some > MOOC, and ended up putting a symlink in somewhere like /usr/lib* , > because Rstudio was only available as a binary with the location > of the shared lib hard-baked into it.So it looks like a symlink might be the answer for me. I would still like to know why /usr/lib/R/lib/libR.so was not refreshed on the most recent build, but.> Depending on your <various flags> this may be irrelevant, apologies > in that case.Not to worry. Thanks for taking an interest. cheers, Rolf -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276
Berwin A Turlach
2018-Aug-23 14:04 UTC
[R] R shared library (/usr/lib64/R/lib/libR.so) not found.
G'day Rolf, On Thu, 23 Aug 2018 22:57:35 +1200 Rolf Turner <r.turner at auckland.ac.nz> wrote:> I *think* that this is an R question (and *not* an RStudio question!)Others may disagree... :)> I have, somewhat against my better judgement, decided to experiment > with using RStudio.Very good if you are still involved with teaching and need to use the same environment as your student... or want to try some new IDE... If you have a good set-up that works for you, a bit more difficult to see why you want to change... RStudio's editor allegedly has an Emacs style but I find that style more confusing than helpful... half of the short-cuts do not seem to work... But it is a nice IDE...> Then I tried to start RStudio ("rstudio" from the command line) > and got a pop-up window with the error message: > > > R shared library (/usr/lib64/R/lib/libR.so) not found. If this > > is a custom build of R, was it built with the --enable-R-shlib > > option?Yes, I regularly got that too, until I changed my R installation scripts ....> Oops, no, I guess it wasn't. So I carefully did a > > sudo make uninstall > make clean > make distcleanTo bad that you did this. There should have been a file called "config.log" in that directory, and the top lines of that file would have told you with which option ./configure was called, in particular whether you had used the --enable-R-shlib flag.> and then did > > ./R-3.5.1/configure <various flags> > > making sure I added the --enable-R-shlib flag.Well, some of the other flags might also be important...> Then I did make and sudo make install. It all seemed to go ... > but then I did > > rstudio > > again and got the same popup error. > > There is indeed *no* libR.so in /usr/lib64/R/lib.I wonder why rstudio tries to look into /usr/lib64. AFAICT, rstudio queries the R that it uses for its home directory and then expects libR.so to be at a specific location relative to this home directory. And it expects that the installation does not use sub-architectures, that is what tripped me up.> There *is* a libR.so in /usr/lib/R/lib, but (weirdly) ls -l reveals > that it dates from the my previous install of R-3.5.1 for which I > *did not* configure with --enable-R-shlib.Are you sure? I am running Ubuntu 18.04 too. My system has /usr/lib/libR.so and /usr/lib/R/lib/libR.so, with the former being a link to the latter. And these were installed via `r-base-core` which seems to be a requirement for `ess`. (The long list of `ess` on Ubuntu, together with its insistence of installing r-base-core and a whole bunch of r-cran-* package is IMHO ridiculous. Nearly bad enough to make me consider installing ESS from source again.) So the /usr/lib/R/lib/libR.so could be from r-base-core (if you somehow installed that package). Obviously you have sudo rights on your machine, so I would suggest to try: sudo updatedb locate libR.so To see how many libR.so you have installed and where they are> Can anyone explain to me WTF is going on?Not with much more information, e.g. what those "<various flags>" to .configure were. Also, the great strength of unix system is that you can influence the behaviour of programs via system variables... unfortunately that is also one of its greatest weaknesses when it comes to finding out why programs do not behaved the way you expect them to work. Some stray environment variable might cause all this problem.> What should I do? Just make a symbolic link > from /usr/lib/R/lib/libR.so to /usr/lib64/R/lib/libR.so?I would not recommend this. If this file is from another installation, you are just asking for trouble down the road, which would then be even harder to debug.> It bothers me that /usr/lib/R/lib/libR.so was not "refreshed" from my > most recent install of R.Me too. But I think you should never install to this location in the first place. AFAICT, /usr/lib/R/lib/libR.so is installed by r-core-base, so if you install your own version there and then a "apt-get update" updates r-core-base, you will end up with a broken system. I learned the hard way long time ago not to install any software in areas where Ubuntu packages are installed. I restrict myself to install to /usr/local or /opt (with /opt often being on a separate partition so that material installed there survive if I have to install/upgrade Ubuntu from scratch).> I plead for enlightenment.Not sure whether my comments were very helpful. But you should probably find out why your custom installed version of R tells RStudio to look at /usr/lib64. A "locate libR.pc" could be helpful. on my system this returns /usr/lib/pkgconfig/libR.pc (from r-base-core) and /opt/R/R-3.5.1/lib/pkgconfig/libR.pc (my installation from source). Cheers, Berwin
Ista Zahn
2018-Aug-24 13:10 UTC
[R] R shared library (/usr/lib64/R/lib/libR.so) not found.
On Thu, Aug 23, 2018 at 6:57 AM Rolf Turner <r.turner at auckland.ac.nz> wrote:> > > I *think* that this is an R question (and *not* an RStudio question!)I think this is actually and Ubuntu question, and probably belongs on R-sig-debian.> > I have, somewhat against my better judgement, decided to experiment with > using RStudio. > > I downloaded and install RStudio. Easy-peasy. Nice lucid instructions. > > Then I tried to start RStudio ("rstudio" from the command line) > and got a pop-up window with the error message: > > > R shared library (/usr/lib64/R/lib/libR.so) not found. If this > > is a custom build of R, was it built with the --enable-R-shlib option? > > Oops, no, I guess it wasn't. So I carefully did a > > sudo make uninstall > make clean > make distclean > > and then did > > ./R-3.5.1/configure <various flags> > > making sure I added the --enable-R-shlib flag. > > Then I did make and sudo make install.IMO if you are compiling and installing software yourself on Linux your are Doing It Wrong. Use the package manager, that is what it is there for. --Ista It all seemed to go ...> but then I did > > rstudio > > again and got the same popup error. > > There is indeed *no* libR.so in /usr/lib64/R/lib. > > There *is* a libR.so in /usr/lib/R/lib, but (weirdly) ls -l reveals that > it dates from the my previous install of R-3.5.1 for which I *did not* > configure with --enable-R-shlib. > > Can anyone explain to me WTF is going on? > > What should I do? Just make a symbolic link from /usr/lib/R/lib/libR.so > to /usr/lib64/R/lib/libR.so? > > It bothers me that /usr/lib/R/lib/libR.so was not "refreshed" from my > most recent install of R. > > I plead for enlightenment. > > cheers, > > Rolf Turner > > P.S. I'm running Ubuntu 18.04. And the previous install of R was done > under Ubuntu 18.04. > > R. T. > > -- > Technical Editor ANZJS > Department of Statistics > University of Auckland > Phone: +64-9-373-7599 ext. 88276 > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Rolf Turner
2018-Aug-24 23:20 UTC
[R] R shared library (/usr/lib64/R/lib/libR.so) not found.
See in-line below. On 08/25/2018 01:10 AM, Ista Zahn wrote:> On Thu, Aug 23, 2018 at 6:57 AM Rolf Turner <r.turner at auckland.ac.nz> wrote: >> >> >> I *think* that this is an R question (and *not* an RStudio question!) > > I think this is actually and Ubuntu question, and probably belongs on > R-sig-debian.Well, it's about installing R --- *could* be independent of OS.>> >> I have, somewhat against my better judgement, decided to experiment with >> using RStudio. >> >> I downloaded and install RStudio. Easy-peasy. Nice lucid instructions. >> >> Then I tried to start RStudio ("rstudio" from the command line) >> and got a pop-up window with the error message: >> >>> R shared library (/usr/lib64/R/lib/libR.so) not found. If this >>> is a custom build of R, was it built with the --enable-R-shlib option? >> >> Oops, no, I guess it wasn't. So I carefully did a >> >> sudo make uninstall >> make clean >> make distclean >> >> and then did >> >> ./R-3.5.1/configure <various flags> >> >> making sure I added the --enable-R-shlib flag. >> >> Then I did make and sudo make install. > > IMO if you are compiling and installing software yourself on Linux > your are Doing It Wrong. Use the package manager, that is what it is > there for.I was pretty sure that the foregoing was a complete red herring. And I was right. I have been told by younger and wiser heads that installing from source is The Right Thing to Do. Moreover I'd always had the impression that the version of R provided by the package manager persistently lags one or two releases behind the current version. However, given that the suggestion had been made, I decided I'd try it. The process for installing R using the package manager is far from straightforward and few people give clear instructions on this issue. (Instructions are usually incomplete and full of jargon and acronyms that the instructors blithely assume assume that the instructees understand. (They *don't*! In this instance (mirabile dictu!) I managed (using Uncle Google) to find very clear and explicit instructions at: https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-18-04-quickstart I followed these instructions, and everything went swimmingly. I indeed got the current version of R (3.5.1, "Feather Spray"). So my previous impression was incorrect (given that one carefully follows the rather complex installation procedures, at least). Interestingly (???) the "new" R was installed in /usr/bin and not in /usr/local/bin. I then tried issuing the command: rstudio Exactly the same pop-up error. No help at all, as I expected. I then tried sudo apt install r-base-dev thinking that this might be needed to get the libR.so created (in the right place). No joy. I then tried the symlink strategy that I had previously suggested. No joy there either. Then finally, in desperation, I copied libR.so from /usr/lib/R/lib to /usr/lib64/R/lib. Bingo!!! I can now start Rstudio!!! It remains mysterious to me why the symlink procedure did not work, whereas making a copy of libR.so *did* work. However I guess this really doesn't matter. It's now working. cheers, Rolf> --Ista > > It all seemed to go ... >> but then I did >> >> rstudio >> >> again and got the same popup error. >> >> There is indeed *no* libR.so in /usr/lib64/R/lib. >> >> There *is* a libR.so in /usr/lib/R/lib, but (weirdly) ls -l reveals that >> it dates from the my previous install of R-3.5.1 for which I *did not* >> configure with --enable-R-shlib. >> >> Can anyone explain to me WTF is going on? >> >> What should I do? Just make a symbolic link from /usr/lib/R/lib/libR.so >> to /usr/lib64/R/lib/libR.so? >> >> It bothers me that /usr/lib/R/lib/libR.so was not "refreshed" from my >> most recent install of R. >> >> I plead for enlightenment. >> >> cheers, >> >> Rolf Turner >> >> P.S. I'm running Ubuntu 18.04. And the previous install of R was done >> under Ubuntu 18.04. >> >> R. T.-- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276