Skip to content

[Rcpp-devel] What is /usr/bin/r ?

4 messages · Dirk Eddelbuettel, Mike Willis

#
I'm making an rpm package to deploy to Linux machines I manage that 
contains, amongst other things, a copy of the Rcpp package. The purpose 
of this is that when a clsas that uses R is taught the lecturer doesn't 
have to start by getting all the students to install all the required 
packages. The package is made by installing all the packages myself, 
then taking a copy of my R library and packaging that to put the files 
in to the global R library directory. I've done this multiple times over 
the years with no problem.

On this occasion one of the requested packages evidently drags in Rcpp 
as a dependency and when I try to install my rpm package I get a 
dependency error that nothing provides /usr/bin/r. I've traced this to 
the Rcpp package which contains 44 files that begin

#!/usr/bin/r -t

Four randomly selected examples of  those 44 are:

examples/RcppInline/RcppInlineExample.r
examples/FastLM/fastLMviaArmadillo.r
unitTests/runit.RObject.R
unitTests/runit.Date.R


Can someone tell me what /usr/bin/r refers to?

The executable for R is /usr/bin/R and it doesn't accept a -t option.


Please note I know next to nothing about R and even less about Rcpp.


thanks,

mike
#
Mike,
On 10 March 2014 at 14:41, Mike Willis wrote:
| 
| I'm making an rpm package to deploy to Linux machines I manage that 
| contains, amongst other things, a copy of the Rcpp package. The purpose 
| of this is that when a clsas that uses R is taught the lecturer doesn't 
| have to start by getting all the students to install all the required 
| packages. The package is made by installing all the packages myself, 
| then taking a copy of my R library and packaging that to put the files 
| in to the global R library directory. I've done this multiple times over 
| the years with no problem.
| 
| On this occasion one of the requested packages evidently drags in Rcpp 
| as a dependency and when I try to install my rpm package I get a 
| dependency error that nothing provides /usr/bin/r. I've traced this to 

It is from littler:

   edd at max:~$ dpkg -S /usr/bin/r
   littler: /usr/bin/r
   edd at max:~$ 

which, if memory serves, is also on some yum archives. I prefer Ubuntu and
Debian, and have it packaged there. 

But I also suspect your analysis may be wrong. See below:

| the Rcpp package which contains 44 files that begin
| 
| #!/usr/bin/r -t
| 
| Four randomly selected examples of  those 44 are:
| 
| examples/RcppInline/RcppInlineExample.r
| examples/FastLM/fastLMviaArmadillo.r

Example files are called by R during R CMD check, the shebang is merely a
courtesy for users who also want to call the installed file (and they still
need to make it chmod 0755)

| unitTests/runit.RObject.R
| unitTests/runit.Date.R

Ditto. 

All unit test files are called by the unit test framework (here: RUnit)
wrappers.

Just because you see a shebang should not imply a depend.

Can you share the exact error, please?
 
| Can someone tell me what /usr/bin/r refers to?
| 
| The executable for R is /usr/bin/R and it doesn't accept a -t option.

Operating systems for grown-ups are case-sensitive. /usr/bin/R != /usr/bin/r
 
| Please note I know next to nothing about R and even less about Rcpp.

Then maybe you should let someone else do the scripting, or at least ask for
local help. Adam Johansen and Yan Zhou over in Statistics are friends and may
be able to help you.

If this really was a hard constraint, CRAN would tell me in no uncertain
terms.  I believe you have a false positive, and should be able to tell rpm
to remain calm and carry on.

Lastly, if it really were a bug, we'd address.  So far I don't buy that it is
a bug.

Cheers, Dirk
#
When I try to install my rpm package I get

Problem: This request will break your system!
   nothing provides /usr/bin/r needed by R-cran-packages-3.0.3-0.x86_64

When I build the package I see rpmbuild adding /usr/bin/r as a requirement:

Requires: /bin/bash /usr/bin/r libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5) 
[etc]

This is expected given that /usr/bin/r appears in the shebang line of 
some files being packaged. Even though those files don't have execute 
bit set.
Unless I'm misunderstanding what you mean, I am not doing any scripting. 
What I'm doing is actually the result of a request by Adam Johansen. 
Rcpp isn't mentioned in Adam's request but gets installed as a 
dependency of a package Adam has requested be made available, lme4.
OK. Evidently this is one of those cases where rpmbuild automatically 
adding what it considers to be dependencies is not helpful so I'll tell 
it not to do that.


thanks,

mike
#
On 10 March 2014 at 15:57, Mike Willis wrote:
| 
| > Just because you see a shebang should not imply a depend.
| >
| > Can you share the exact error, please?
| 
| 
| When I try to install my rpm package I get
| 
| Problem: This request will break your system!
|    nothing provides /usr/bin/r needed by R-cran-packages-3.0.3-0.x86_64
| 
| When I build the package I see rpmbuild adding /usr/bin/r as a requirement:
| 
| Requires: /bin/bash /usr/bin/r libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5) 
| [etc]
| 
| This is expected given that /usr/bin/r appears in the shebang line of 
| some files being packaged. Even though those files don't have execute 
| bit set.

Right.  I think I get a warning (one can override) when building .deb
packages. [ But it is moot as we do have /usr/bin/r. And just recently I
removed a 'Depends: littler' from the Debian package for RcppArmadillo. In
any even, Debian/Ubuntu. ]

Worst case, you could just run sed over those files and kill the shebang
line.  Or you could quickly package littler -- 'configure; make; make
install' work just fine so setting up a spec file for rpm ought to be quick.
 
| > Then maybe you should let someone else do the scripting, or at least ask for
| > local help. Adam Johansen and Yan Zhou over in Statistics are friends and may
| > be able to help you.
| 
| Unless I'm misunderstanding what you mean, I am not doing any scripting. 
| What I'm doing is actually the result of a request by Adam Johansen. 
| Rcpp isn't mentioned in Adam's request but gets installed as a 
| dependency of a package Adam has requested be made available, lme4.

Right. 
 
| > If this really was a hard constraint, CRAN would tell me in no uncertain
| > terms.  I believe you have a false positive, and should be able to tell rpm
| > to remain calm and carry on.
| 
| OK. Evidently this is one of those cases where rpmbuild automatically 
| adding what it considers to be dependencies is not helpful so I'll tell 
| it not to do that.

Or satisfy the depend with a package providing /usr/bin/r. I personally find
it rather useful for scripting with R and use it many times a day, including
in cronjobs.  But then I co-wrote littler so I am not free of bias :)

Let me know how I can help you with this, but let's maybe move it off this
list as it is all a little tangential for Rcpp.

Dirk