R shared library (/usr/lib64/R/lib/libR.so) not found.

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

R shared library (/usr/lib64/R/lib/libR.so) not found.

Rolf Turner

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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

R help mailing list-2
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
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Rolf Turner

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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Berwin A Turlach-3
In reply to this post by Rolf Turner
G'day Rolf,

On Thu, 23 Aug 2018 22:57:35 +1200
Rolf Turner <[hidden email]> 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 distclean

To 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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Berwin A Turlach-3
In reply to this post by Rolf Turner
G'day Rolf,

On Thu, 23 Aug 2018 23:34:38 +1200
Rolf Turner <[hidden email]> wrote:

> I guess I should have said --- I did
>
>      sudo make prefix=/usr install
>
> which puts stuff into /usr rather than into /usr/local.

???

I do not remember ever specifying "prefix=foo" at the make install
stage.  Not for any software that uses autoconf &c.

I thought the prefix should be specified to ./configure and after that
just
        make
        make check
        make install

I am pretty sure that the location of RHOME is set by the path
specified (explicitly or implicitly) to ./configure.  If you then
install R at another location with your construct, some problems seem
to be pre-programmed.  But I could be wrong.
 
> 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.

In my experience this is a false comfort.  Set the search path so
that /opt/bin or /usr/local/bin is early on and finds programs you
install to those location.  

Installing to /usr will sooner or later lead to tears if your program
"conflicts" with some Ubuntu package (which might have been installed
to satisfy the requirement of another package that you needed).  If
that package is update during an "apt-get update", you can end up with
a broken system.  
 
> > 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.  

The location is only hard-coded in relation to RHOME and with the
assumption that you are not using a sub-architecture on Ubuntu.  AFAIK,
binary Ubuntu distributions of R do not use sub-architectures and there
should be no problem on an Ubuntu system as long as all software is
installed via Ubuntu.  But this is probably a question better discussed
on r-sig-Debian

> So it looks like a symlink might be the answer for me.

Only if you can be sure that that libR.so is compatible with the R
version that you seem to be using.  The official r-base-core package
from Ubuntu seems to be R 3.4.4.  If you added the CRAN repository to
your Ubuntu system, you might have a newer version installed.  But if
your installation is partly a self-compiled R-3.5.1 version that is
then linked to an R 3.4.4 libR.so in /usr/lib/R/lib/ (from
r-cran-base), you are inviting trouble.

Cheers,

        Berwin

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

plangfelder
On Thu, Aug 23, 2018 at 7:33 AM Berwin A Turlach
<[hidden email]> wrote:

>
> G'day Rolf,
>
> On Thu, 23 Aug 2018 23:34:38 +1200
> Rolf Turner <[hidden email]> wrote:
>
> > I guess I should have said --- I did
> >
> >      sudo make prefix=/usr install
> >
> > which puts stuff into /usr rather than into /usr/local.
>
> ???
>
> I do not remember ever specifying "prefix=foo" at the make install
> stage.  Not for any software that uses autoconf &c.
>
> I thought the prefix should be specified to ./configure and after that
> just
>         make
>         make check
>         make install
>
> I am pretty sure that the location of RHOME is set by the path
> specified (explicitly or implicitly) to ./configure.  If you then
> install R at another location with your construct, some problems seem
> to be pre-programmed.  But I could be wrong.

The manual, specifically

https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installation

documents this way of choosing the installation directory.

Peter

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Berwin A Turlach-3
G'day Peter,

On Thu, 23 Aug 2018 08:45:37 -0700
Peter Langfelder <[hidden email]> wrote:

> The manual, specifically
>
> https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installation
>
> documents this way of choosing the installation directory.

Yes, with the caveat that one needs GNU or Solaris make (which would be
the case on Ubuntu).  So it is hardly the recommended way.  

As I read the R Administration Manual, the recommended way is to specify
the location at which you want to install R via ./configure.

Cheers,

        Berwin

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Ista Zahn
In reply to this post by Rolf Turner
On Thu, Aug 23, 2018 at 6:57 AM Rolf Turner <[hidden email]> 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
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Rolf Turner

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 <[hidden email]> 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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Dirk Eddelbuettel

Rolf,

I noticed this thread started by you as well as a few of the excellent
follow-ups. While it conclcuded, allow me a few quick comments:

 - Some of us go through some effort to provide R on Ubuntu (and Debian) in a
   reliable and reproducible manner. And it works and is used by many people.

 - The basic r-base (and r-base-core etc) packages work in the distribution,
   but may be older as the distribution is taken as snapshots in time.  Hence
   the Ubuntu mirror via CRAN. That way you get a choice between eg R 3.4.4
   (not that old) and R 3.5.1. (brand new) in the current Ubuntu 18.04.

 - The (short) instructions at CRAN work: add a repo, install from it.
   Neither they nor the longer (more recent) blog post you found (which says
   the same, with more pictures) suggest to link or move libraries around.

 - We even have "proof" in the sense of fully automated build and use
   systems. Docker is just one example.  Eg this Dockerfile build the r-base
   container available as rocker/r-base (as well as the official r-base)
      https://github.com/rocker-org/rocker/blob/master/r-base/Dockerfile
   and eg this one use it and builds on top to generated an RStudio container
      https://github.com/rocker-org/rocker/blob/master/rstudio/testing/Dockerfile 
   Nowhere in either of these "recipes" are library files moved, renamed, or
   otherwise altered.

 - Nobody ever suggested for _any_ Linux distribution to mix its files below
   /usr with your own compilation.  There lies madness, and it may be the
   root cause of the behaviour local to your machine.  Don't do it.

 - Please consider asking Debian and Ubuntu related questions on r-sig-debian.  

Regards, Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Berwin A Turlach-3
In reply to this post by Rolf Turner
G'day Rolf,

On Sat, 25 Aug 2018 11:20:09 +1200
Rolf Turner <[hidden email]> wrote:

> I was pretty sure that the foregoing was a complete red herring.  And
> I was right.

I am not sure whether I agree. :)
 
> I have been told by younger and wiser heads that installing from
> source is The Right Thing to Do.

Younger heads probably have more time on their hands to play around
with installing from source and debugging when things go wrong.  Wiser
heads probably have figured out how they should do so in the first
place. :)

Seriously, years ago I installed quite a bit of software from source,
also to always have the newest version.  And while I was using Debian
unstable I accepted that from time to time an update would leave me
with a broken system and I would have to spend some time to fix it
again.  Nowadays, I rather spend my time on other things and so am
happy to go with most software with whatever version the package
installer of Ubuntu installs.

The one exception is R, but that is for various good reasons:
  * I want to have the 32 bit and 64 bit architecture installed so
    that I can test my packages on both packages.  
  * I would like to keep old versions around, to test my packages on
    them
  * I like to use the R version that is installed in our computer
    lab when preparing teaching material, and the newest version
    otherwise.

If I ever get the feeling that all these points are easily achievable
with the compiled packages (without having to play around with docker,
sandboxes etc), I would stop compiling R from source.

> 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.

From the official repositories, yes.  But CRAN provides since longer
than I can remember up-to-date binary packages for the most common
Linux distributions.  AFAIK, Debian and Ubuntu packages are available
thanks to Dirk Eddelbuettel (initially? mainly?) and others.

> The process for installing R using the package manager is far from
> straightforward and few people give clear instructions on this issue.

1.) Start a web browser
2.) Go to your favourite CRAN server
3.) Select 'Download R for Linux'
4.) Select the directory "ubuntu/" from the page that is served
5.) Select README.html from the page that is served
6.) Follow the instructions

> (Instructions are usually incomplete and full of jargon and acronyms
> that the instructors blithely assume assume that the instructees
> understand.  

I am sure (some) of my students have the same complains about my
lecturing....  

> (They *don't*! In this instance (mirabile dictu!) I managed (using
> Uncle Google)

You were lucky in this case, usually Uncle Google serves me with
somewhat out-dated (if not wrong) information when I run into a
technical problem with linux.....

> 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.

You were lucky that you are not sitting behind a firewall (as I seem to
be, not sure whom I have to thank for that).  For me the first step
(installing the GPG key) fails and some further googling was
necessary.  Though, I was working from the CRAN instructions.

> Interestingly (???) the "new" R was installed in /usr/bin and not in
> /usr/local/bin.

Of course, it is a system Ubuntu package, so it installs to /usr/bin.

> I then tried issuing the command:
>
>      rstudio
>
> Exactly the same pop-up error.  No help at all, as I expected.

O.k., as I got a new machine, I installed (X)ubuntu 18.04 from scratch,
no update from an earlier version.  The R version installed from
r-base-core was R 3.4.4.  In a terminal in which I manipulated my PATH
variable so that /usr/bin is early on, I could start R without problem,
and I could start rstudio without problem.

After following the instructions on CRAN and updating my apt
information, I have now R 3.5.1 installed.  And it starts fine from the
command line as does rstudio.  And rstudio starts now with R 3.5.1.

Both these packages work out of the box.  Thus I wonder whether you
have somehow messed up your system during the attempt to install R from
source.  Or have some environment variables set that provide rstudio
with wrong information....

> Then finally, in desperation, I copied libR.so from /usr/lib/R/lib to
> /usr/lib64/R/lib.  Bingo!!!  I can now start Rstudio!!!

I keep wondering why you have a /usr/lib64.

On my Ubuntu boxes, in /usr I have /lib, /lib32 and /libx32, but no
lib64.  As far as I know, Debian/Ubuntu 64bit implementations always
used /usr/lib for its 64 bit libraries and /usr/lib32 for the 32 bit
versions (unlike other distributions who used /usr/lib64 for the former
and /usr/lib for the latter).

In fact, a 'locate /lib64' on my Ubuntu 18.04 system (less than 2 week
old fresh installation) shows:

/lib64
/lib64/ld-linux-x86-64.so.2
/usr/src/linux-headers-4.15.0-32/arch/sh/lib64
/usr/src/linux-headers-4.15.0-32/arch/sh/lib64/Makefile
/usr/src/linux-headers-4.15.0-33/arch/sh/lib64
/usr/src/linux-headers-4.15.0-33/arch/sh/lib64/Makefile

So there seems to be a /lib64, but no /usr/lib64.  How did you get
this?  And why does rstudio think it has to look into that directory?

> It remains mysterious to me why the symlink procedure did not work,
> whereas making a copy of libR.so *did* work.

Agreed, that is somebody a mystery.

> However I guess this really doesn't matter.  It's now working.

Until it breaks again. :)

I would advise to start at some point with a clean Ubuntu installation,
and then restrict yourself to /usr/local and /opt when installing
software from source.  

Cheers,

        Berwin

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Rolf Turner

On 08/26/2018 02:59 AM, Berwin A Turlach wrote:

> G'day Rolf,
>
> On Sat, 25 Aug 2018 11:20:09 +1200
> Rolf Turner <[hidden email]> wrote:
>
>> I was pretty sure that the foregoing was a complete red herring.  And
>> I was right.
>
> I am not sure whether I agree. :)

Huh?  Black is white and up is down???

I did as advised and it made absolutely no difference.  Ergo  I was right.

<SNIP>

> I keep wondering why you have a /usr/lib64.

<SNIP>

> .... How did you get this?

I have no idea.  It just seems to be there.  And it seems that rstudio
thinks that it should be there.

> And why does rstudio think it has to look into that directory?
How would I know?  You would have to ask RStudio, not me.

Anyway, I seem to have (for the time being at least) a working system,
and I don't feel like wasting any more time on this issue.

cheers,

Rolf

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R shared library (/usr/lib64/R/lib/libR.so) not found.

Berwin A Turlach-3
G'day Rolf,

On Sun, 26 Aug 2018 13:00:34 +1200
Rolf Turner <[hidden email]> wrote:

> On 08/26/2018 02:59 AM, Berwin A Turlach wrote:
>
> > I am not sure whether I agree. :)  
>
> Huh?  Black is white and up is down???

Nope, but as I said, on my machine RStudio and the R installed from the
Ubuntu repositories worked out of the box.

After adding the CRAN repositories to my apt configuration and
upgrading R, RStudio and the new R version worked again out of the box.

For the R versions that I compile from source, as I install sub
architectures, I need to install symbol links from where libR.so
actually is to where Rstudio expects them.  And RStudio works out of
the box with all these installation, i.e. it seems to follow symbolic
links.
 
> I did as advised and it made absolutely no difference.  Ergo  I was
> right.

That is your conclusion from the data, are you are perfectly entitled
to it. :)

I still think that this is one of the 5% of the cases where you got
your inference wrong.  Given that for me (and presumably many others
[but I neither follow r-sig-Debian nor the Rstudio forums, so I may
have a biased input]) everything works out of the box, my conclusion
from the data is that you have FUBAR'd your system.

Now, this can be from the way you tried to compile R from source (you
never told us what you exactly specified to ./configure, but we would
also have to know whether you made changes to config.site before
compilation) or it could be from some environment variables (set long
time ago and since forgotten [if so, where is it set ~/.bashrc? ~/.R?).

> <SNIP>
>
> > I keep wondering why you have a /usr/lib64.  
>
> <SNIP>
>
> > .... How did you get this?  
>
> I have no idea.  It just seems to be there.  And it seems that
> rstudio thinks that it should be there.

As far as I can tell, RStudio expects libR.so in a certain directory
relative to where the home directory (as reported by R on query) of R.
But RStudio's behaviour can also be influenced by environment variable.
 
So the fact that RStudio keeps looking at /usr/lib64 is for me evidence
that your system is compromised, and that RStudio is not starting the
version of R installed from the Ubuntu package manager.

> Anyway, I seem to have (for the time being at least) a working
> system, and I don't feel like wasting any more time on this issue.

Fair enough, but I am concerned that this issue will raise it head
sooner or later again.  So my final advice is to stick to the old adage
from sports: Never change a winning team.  If you system works for you
know, freeze it.  No more updates/upgrades.   Otherwise, good luck when
you try to update R next....

Cheers,
       
        Berwin

______________________________________________
[hidden email] 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.