Giter VIP home page Giter VIP logo

littler's Introduction

littler: A scripting and command-line front-end for GNU R

CI License CRAN r-universe Dependencies Downloads Last Commit Documentation

So What Is It For?

#!/usr/bin/env r              ## for use in scripts

other input | r               ## for use in pipes

r somefile.R                  ## for running files

r -e 'expr'                   ## for evaluating expressions

r --help                      ## to show a quick synopsis

Examples?

Plenty. See the examples vignette for a full set of introductory examples. Also see the examples/ directory for a full 28 example scripts, as well as maybe the older tests directory both of which are installed with the package.

Some scripts I use daily or near daily (in alphabetical order):

build.r                                ## builds from the current directory
c4c.r                                  ## submits current directory to winbuilder
compAttr.r                             ## run compileAttributes() for a Rcpp package
dratInstert.r 1.2-3.tar.gz -r /srv     ## inserts package into drat repo
install.r abc def                      ## installs packages abc and def
install.r abc_1.2-3.tar.gz             ## installs given tarball
install2.r -l /tmp/lib abc def         ## installs abc and def into /tmp/lib
rcc.r abc_1.2-3.tar.gz                 ## run's R CMD check via Gabor's rcmdcheck
render.r foo.Rmd                       ## calls rmarkdown::render()
roxy.r                                 ## run roxygenize() for a package (only Rd creation)
update.r                               ## updates any currently installed packages

Installation

Version 0.3.0 or later

The package resides on the CRAN network and can be installed via

install.packages("littler")

Note that the package states OS_type: unix. It works great on all Linux variants, with a naming caveat on macOS (see below and the FAQ vignettes) and not at all on Windows (but could be ported just like RInside has been--the two show architectural similarities).

Previous Versions up to 0.2.3

In general, simply running the script bootstrap will configure and build the executable. Running make install (possibly as sudo make install) will install the resulting binary.

On Linux systems, ensure you have the autotools-dev package (or its equivalent on non-Debian/Ubuntu systems). On OS X, you may need to run brew install automake autoconf to get all the tools.

Alternate Naming

On some operating systems such as OS X, r is not different from R. As this risks confusing the main binary R for the R system with our smaller scripting frontend r, we suggest to consider running configure --program-prefix="l" which this leads to installation of a binary lr instead of r.

Alternate R Version

As littler uses autoconf its AC_PATH_PROG() macro to find R, one can simply adjust the PATH when calling configure (or, rather, bootstrap) to have another version of R used. For example, on a server with R-devel in this location, the following builds littler using this R-devel version: PATH="/usr/local/lib/R-devel/bin/:$PATH" ./bootstrap.

More Information

For more information about littler, please see

(but note that the latter now overlaps with the example vignette).

Authors

Jeff Horner (2006 to 2008) and Dirk Eddelbuettel (since 2006)

License

GPL (>= 2)

littler's People

Contributors

1beb avatar aaronwolen avatar berwinturlach avatar cboettig avatar csgillespie avatar daroczig avatar eddelbuettel avatar eitsupi avatar ellert avatar enchufa2 avatar jeffreyhorner avatar jeroen avatar johnkerl avatar pmtempy avatar stewid avatar thell avatar zeehio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

littler's Issues

change the second example code

Hi,
if I run the second example

ls -l /boot | awk 'BEGIN {print "size"} !/^total/ {print $5}' | r -de "print(summary(X[,1])); stem(X[,1])"

I have

   Mode
logical
Error in stem(X[, 1]) : 'x' must be numeric

because my /boot folder is empty. Probably it should be better to change /boot in /bin, to use a more generic path.

Thank you

Exit status for example scripts

Most example scripts do not behave like good unix citizens; they always exit with status 0:

$ install.r "foo"; echo $?
Warning message:
package ‘foo’ is not available (for R version 3.6.1)
0

Same for rcc.r where I expected $? > 0 for a failing check.

FR for support commandArgs

While argv is somehow clear way it requires the R script to be adjusted to be called from littler. littler could hook the commandArgs function and inject own argv it would allow running scripts originally written for Rscript - more portable.

a note about using littler inside zsh shell

Hi,
if I run the first example in zsh shell echo 'cat(pi^2,"\n")' | r I have littler: Incomplete Line! Need more code! (2).

If I run echo 'cat(pi^2)' | r, it's ok.

Could it be useful to add some related notes in the documentation?

Thank you

howto use configure --program-prefix="l"

I would like to try out littler on a mac

There is no script called configure in the littler repo so I am not sure how to do:

./configure --program-prefix="l"

What am I missing? Thanks

Rename binary to 'lr' on OS X?

OS X is case-insensitive, we cannot have 'r' (us) and 'R' (aka the interactive GNU R).

So should the binary be installed as /usr/bin/lr ? That handle appears to be free everywhere. On Linux we could retain r for backwards compatibility and ease of use but also install /usr/bin/lr.

-p arguably should not print value of implicit read.csv caused by -d

Rather, -p should ONLY print the results of evaluating the value of -e
for example, in the below, we only want to see the summary.

$ seq 5 | r -dpe 'summary(X)'
  X1
1  2
2  3
3  4
4  5
       X1      
 Min.   :2.00  
 1st Qu.:2.75  
 Median :3.50  
 Mean   :3.50  
 3rd Qu.:4.25  
 Max.   :5.00  

I would be surprised if changing the behavior as above would break anything.

installation error: /usr/bin/ld: cannot find -llzma

Tried to install littler locally on a linux cluster without root access and got the following issue. Do you see any simple quick fix? (I'm a novice user of linux, C, compliation, etc)

littler.c: In function ‘littler_InitTempDir’:
littler.c:352:5: warning: implicit declaration of function ‘setenv’ [-Wimplicit-function-declaration]
     if (setenv("R_SESSION_TMPDIR",tmp,1) != 0){
     ^
littler.c: In function ‘main’:
littler.c:708:13: warning: implicit declaration of function ‘strtok_r’ [-Wimplicit-function-declaration]
             token = strtok_r(ptr, ",", &strptr);
             ^
littler.c:708:19: warning: assignment makes pointer from integer without a cast
             token = strtok_r(ptr, ",", &strptr);
                   ^
/usr/bin/ld: cannot find -llzma
/usr/bin/ld: cannot find -lbz2
collect2: error: ld returned 1 exit status
make: *** [r] Error 1
ERROR: compilation failed for package ‘littler’

Found something on SO like this one but couldn't figure out how to apply it in this context here.

Session info:

R version 3.5.1 (2018-07-02)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.7 (Maipo)

Matrix products: default
BLAS: /usr/local/sas/grid/R-3.5.1-linux/lib64/R/lib/libRblas.so
LAPACK: /usr/local/sas/grid/R-3.5.1-linux/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] methods base

loaded via a namespace (and not attached):
[1] utils_3.5.1

[1] "/home/city/sbbg070/R_library/3.5"
[2] "/usr/local/sas/grid/R-3.5.1-linux-library"
[3] "/usr/local/sas/grid/R-3.5.1-linux/lib64/R/library"

gcc (GCC) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.

Add symlink instructions to startup.

From discussion on r-sig-macos, the instructions here are not specific:

When installing littler using install.packages('littler'), I got below message:

  • new binary r installed in bin/ subdirectory
  • consider adding a symbolic link from, e.g., /usr/local/bin
  • on OS X, you may have to name this 'lr' instead

How can I create this symbolic link?

Suggestion from @s-u on r-sig-macos was to include:

system(paste("sudo ln -s",shQuote(system.file("bin","r",package="littler")),"/usr/local/bin/lr"))

Any objection to modifying the line here:

littler/R/init.R

Lines 15 to 19 in 277700a

if (unname(Sys.which("lr")) == "") {
packageStartupMessage("You could link to the 'r' binary installed in\n'",
system.file("bin", "r", package="littler"), "'\n",
"as '/usr/local/bin/lr' in order to use 'lr' for scripting.")
}

This could also be shown under the Linux variant as well.

Trouble with installGithub.r example

I'm trying to run the installGithub.r example to install RcppCore/RcppEigen and it seems to be failing with unused argument (update = TRUE), which I'm finding particularly confusing, as update seems to be have changed to upgrade.

The Dockerfile I'm running is

FROM rocker/r-ver:3.4.1

RUN install2.r remotes

RUN installGithub.r RcppCore/RcppEigen

Without wanting to jump the gun, I thought it might be something down stream of rocker-org/rocker#227 - Is this actually where this issue should be?


Full report

akhil@pc:~/scratch/docker/littler$ docker build --no-cache -t test .
Sending build context to Docker daemon  60.42kB
Step 1/3 : FROM rocker/r-ver:3.4.1
 ---> cb8224c0a148
Step 2/3 : RUN install2.r remotes
 ---> Running in 6f7b369fdfd7
trying URL 'https://mran.microsoft.com/snapshot/2017-07-03/src/contrib/remotes_1.0.0.tar.gz'
Content type 'application/octet-stream' length 37958 bytes (37 KB)
==================================================
downloaded 37 KB

* installing *source* package ‘remotes’ ...
** package ‘remotes’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (remotes)

The downloaded source packages are in
	‘/tmp/downloaded_packages’
 ---> dc33ed7ad891
Removing intermediate container 6f7b369fdfd7
Step 3/3 : RUN installGithub.r RcppCore/RcppEigen
 ---> Running in ac5f8afc66ee
Downloading GitHub repo RcppCore/RcppEigen@master
Installing 3 packages: lattice, Matrix, Rcpp
Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  unused argument (update = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘lattice’ failed
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  unused argument (update = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘Matrix’ failed
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  unused argument (update = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘Rcpp’ failed
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
ERROR: dependencies ‘Matrix’, ‘Rcpp’ are not available for package ‘RcppEigen’
* removing ‘/usr/local/lib/R/site-library/RcppEigen’
Warning message:
In utils::install.packages(...) :
  installation of package ‘/tmp/remotes774d75edb/RcppCore-RcppEigen-c03cd8a’ had non-zero exit status
 ---> 8d8bf9000743
Removing intermediate container ac5f8afc66ee
Successfully built 8d8bf9000743
Successfully tagged test:latest

update.r / libloc

-l --libloc LIBLOC location in which to install [default: /usr/local/lib/R/site-library]

  1. The description is wrong, libloc is passed to update.packages() as lib.loc and determines which libraries to search through for packages to update. What is described here is the instlib argument of update.packages().
  2. The default is not good. It should default to NULL (which translates to all libraries in .libPaths()).

feature request: support tab delimited files

let -d take a value of the delimiter to use passed as sep to read.csv

actually, two feature requests!

Also implement new option:

-c --colheader    Do columns have a header line?  (Default: non-zero = yes)

I think these two arguments are the most often provided in read.csv

Together, this would allow summarizing a tab-delimited header-less matrix as:

r -d$'\t' -c0 -e 'summary(X)' 

A lot of messages

This is what happens if I ran any R operations from bash.

user@computer:~$ R --vanilla -e 'cat(.3 == .1 + .2)'

R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-conda_cos6-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> cat(.3 == .1 + .2)
FALSE> 

Same if I do echo '.3 == .1 + .2' | R

How do I get only the output of the operation and not the messages of R's commander?

Fails with zsh

zsh> r myscript.R
fc: event not found: myscript.R

bash$ r myscript.R
Loading required package: methods
...
zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)

r --version
r ('littler') version 0.3.0
using GNU R Version 3.2.2 (2015-08-14)
...

R --version
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...

Check if package installed already, if so, ignore

I'm looking through the flags and I don't know if this is a feature. Basically, I have a long CI build process where some packages might already be installed. If so, I want to skip them.

Is there some flag to do this?

install2.r doesn't permit multiple arguments to repo

Can't figure out how to get docopt to allow me to specify multiple repos in the argument to repos.

Mostly this is really annoying when using some custom repo that also depends on some CRAN packages -- since the custom argument overrides the default repo these dependencies can't install automatically.

Seems like this should be a simple thing to fix but for some reason I'm a bit stumped on how to go about it.

-p arguably should not print value of implicit read.csv caused by -d

Rather, -p should ONLY print the results of evaluating the value of -e
for example, in the below, we only want to see the summary.

$ seq 5 | r -dpe 'summary(X)'
  X1
1  2
2  3
3  4
4  5
       X1      
 Min.   :2.00  
 1st Qu.:2.75  
 Median :3.50  
 Mean   :3.50  
 3rd Qu.:4.25  
 Max.   :5.00  

I would be surprised if changing the behavior as above would break anything.

.Rprofile, .First() or the .libPaths() issue / request

The file .littler.r is a way to define options for r. However, .Rprofile files might be already configured and used by users, but it is not regarded by r:

r << EOF
print(.libPaths())
EOF
# [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"      
# [3] "/usr/lib/R/library"           

echo 'source("~/.Rprofile"); .First()' > ~/.littler.r

r << EOF                                                 
print(.libPaths())
EOF
# [1] "/home/setempler/.rlib"         "/usr/local/lib/R/site-library"
# [3] "/usr/lib/R/site-library"       "/usr/lib/R/library"    

It would be nice when r sources .Rprofile files and runs .First() functions, to act more similar to the R startup. Also a '--lib' option seems handy, to use like this:

r - --lib ~/.rlib << EOF
print(.libPaths())
EOF

Used ubuntu 15.04 R 3.1 littler 0.2.2-1

load library error on macos 10.12 with R 3.4.3

I' using macOS 10.12 and have just recently upgraded my R version from 3.3.3 to 3.4.3.

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] littler_0.3.3

loaded via a namespace (and not attached):
[1] compiler_3.4.3 tools_3.4.3    yaml_2.1.16

I have then re-linked the r binary /Library/Frameworks/R.framework/Versions/3.4/Resources/library/littler/bin/r to /usr/local/bin/lr.
Since I get the error

dyld: Library not loaded: /usr/local/clang4/lib/libomp.dylib
 Referenced from: /usr/local/bin/lr
  Reason: image not found
Abort trap: 6

when running R code using r.
The library is located at /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libomp.dylib. So I assume that some PATH is not beeing linked correctly.

I have tried to remove and reinstall the package as well as updating with no luck.
I have then tried to compile the package from source as described for versions prior to 0.2.3 but this didn't work.
If I link the Current R version to 3.3 and link lrto the 3.3 package binary everything works fine again.

Any help on getting this issue solved is highly appreciated!
Thanks in advance!

Thoughts on some possible changes to installGithub.r / installRepo.r

  • Looks like installGithub.r doesn't support the option to pass a CRAN repo (e.g. for installing the dependencies). This can be handy if I need to install a package from github whose dependencies come from a repo other than CRAN. Given that this feature is already in install2.r, would it be reasonable to add here? (Might be confusing since -r option means something different in install2.r vs in installRepo.r, not sure what the right course of action is there).

  • I'd like to add an option to set upgrade_dependencies argument to install_github to FALSE. While automatically upgrading makes sense sometimes, this logic differs from the default behavior of install.packages(), which does not attempt to upgrade all the dependencies on installing a package, and it would be handy to toggle it off.

Would you consider a PR along these lines?

datastdin and header

Hi,
first of all thanks for this very useful program.

The problem is that in my opinion the datastdin should be changed so that it doens't assume the input to have an header. An option to enable the header should be added. This because the current behaviour is in my opinion subtle.

Just to give you an idea the problem affects one example you have on your page because this:

ls -l /boot | awk '!/^total/ {print $5}' | r -e "fsizes <- readLines(file(\"stdin\")); print(length(fsizes))"

is not actually equivalent to this:

ls -l /boot | awk '!/^total/ {print $5}' | r -de "print(length(X[,1]));"

the latter uses the first line as a name for the header of the X table and so the answer is 1 less than the former.

Hope this is clear.

Thank you and best regards,
hcraT

Error: trying to use CRAN without setting a mirror

I'm using littler (0.2.3-2precise0) for Ubuntu 12.04, pulled from http://cran.rstudio.com/bin/linux/ubuntu/. After install (and symbolic links to the scripts in examples), I'm trying to install a package, but get the following error:

ubuntu@ip:~# sudo -Hi
root@ip:~/src# install.r ggplot2
Error in contrib.url(repos, type) : 
  trying to use CRAN without setting a mirror

The bottom of my /etc/R/Rprofile.site has the following:

options(repos = list(CRAN="http://cran.rstudio.com/"))

Am I doing something wrong here? Thanks!

installGithub.r not working in rocker scenario

Perhaps related to #46 , but trying to install a package from github as part of a rocker variant, we get issues with update=TRUE

Repo: https://github.com/stephlocke/installGithubDockerIssue
Results: https://hub.docker.com/r/stephlocke/installgithubdockerissue/builds/b4mbxkusq4syhyekcquxhye/
Salient error text:

�[91mError in download.file(url, destfile, method, mode = "wb", ...) : 
  unused argument (update = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘curl’ failed

dylib error with littler

I am trying to use littler to pipe the output of a gawk script into an r program . I am using the terminal program in the latest build of mac OS.

I installed by downloading and unzipping the mac binary. the unzipped package ended up in my Downloads folder. I tried running it from that location, using the full path name in the command line containing the pipe (if you can suggest the proper location for me to move this package to, I would appreciate it).

I got an error message (shown below, after the command line). I would appreciate any help as to how to resolve this.

Barrys-Mac-mini:home barryzeeberg$ sudo tcpflow -c host 045.077.078.199 | gawk -f /Users/barryzeeberg/Desktop/hearts/tcpflow/new_code/in_line_versions/gawk_programs/both.inline.awk | /Users/barryzeeberg/Downloads/littler/bin/r /Users/barryzeeberg/Desktop/hearts/tcpflow/new_code/in_line_versions/R_code/sfile.inline.R
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
Referenced from: /Users/barryzeeberg/Downloads/littler/bin/r
Reason: image not found
reportfilename: ./report.xml
./report.xml: Operation not supported
Abort trap: 6

Renviron and littler

It appears that littler doesn't read .Renviron files
.
I would offer a PR, but my C is probably not good enough for https://github.com/eddelbuettel/littler/blob/master/src/littler.c

Two asides:

  • An easy workaround is to add readRenviron("~/.Renviron") to ~/.littler.r
  • install2.rdoesn't follow the lib convention with install.packages() - a different default location. But it's probably far to late to consider changing that.

littler hangs on launch

Hi,
I just installed littler and running r in a shell hangs without producing displaying a prompt, or anything else for that matter. I've tried searching for similar issues with no success.
I am on Budgie Ubuntu 17.04 64-bit, and R has been working fine so far.
Does anyone have an inkling about what's wrong?

I want to depend on littler, please export something

I want to use littler from my package, but I don't want to Depend on it, because of the lengthy startup message. I think the message is useful in general, but maybe not so much if littler is just the background machinery of another package.

Then the problem is that I cannot use Imports, either, because then I need to import sg to avoid an R CMD check warning. But there is nothing to import.

I quite like the fact that littler does not export anything. But I think it might be worth exporting a little something so that I can Import the package cleanly. E.g. how about importing a single variable or function r which just points to the binary of littler? That's even (slightly) useful, I don't need to call system.file(), just use littler::r.

Alternative suggestions are also welcome.

littler and R difference on system()

Hi.

I've stumbled across a scenario, which I don't understand. I probally doing something wrong, but can't quite see it.

My setup is:
archlinux
i3wm
bash
urxvt
R
radian

I'm trying to do the following. having a R function, wich I can call from R or in a bash script through littler

My function is

do_open_term <- function() {  
system("urxvt", wait=FALSE)  
}      

my script is
do_open_term.rs:

#!/usr/local/bin/r -tqp  
doutilitiesr::do_open_term()  

in R I can open a new terminal window, with do_open_term(), in the current folder. This terminal seems to work as expected.

When I run my script, do_open_term.rs, from the commandline I seem to get at different environment, which is apparent when I run radian.

I will try to explain the different behaviour.

if I run radian from a normal terminal window, I get radian as expected(with loaded R packages, and loaded Rprofile and radian_profile)

if I start a terminal with my script, and then runs radian. radian starts, but without reading Rprofile, like It don't see Rprofile.
If I run R in this terminal, It also don't run Rprofile. But It has my libpaths.

I would expect littler to start a terminal through system() in the same state as R. Is my understanding wrong?

Can you point me in a direction?

Greetings from Denmark
Dan Olesen

littler for non-R people?

Hi, I do like this package - I think it does a lot what standard R doesn't (or is hidden). I found it yesterday and here are some of my newbie thoughts/ideas:

I understand littler as a wrapper for R. That means also people not familiar with R might come to it (while using someones else scripts,..). I suppose, for such people would be beneficial if:

  1. put basic commands (e.g. install2.r) into more visible path /usr/bin path - the same as command r (question is what commands and how to define path in order to work in all systems)
  2. print help if command run without arguments (e.g. install.r, mph.r are well done, install2.r, r do not have it). This is especially true for r command that is silent if I run it. Printing help would help people who doesnt know the command. Similarly to other standard command like tools like awk - if run without options/parameters print help.

What do you think?

Feature Request: Show package install start and completion

I understand that littler does not want to depend on devtools, but I think it is worth noting that it would be helpful to view when a package starts and completes install, similar to devtools:install_cran(). I think this would be useful from a debugging standpoint, so you can see what C calls (like below) are installing, and for which package. Curious to hear if this would be helpful for others or not.

example:

> devtools::install_cran("purrr")
trying URL 'https://cran.rstudio.com/src/contrib/purrr_0.2.4.tar.gz'
Content type 'application/x-gzip' length 126147 bytes (123 KB)
==================================================
downloaded 123 KB

Installing purrr
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD  \
  INSTALL '/private/var/folders/c9/4v_941557p15th5c9lkxnysr0000gn/T/RtmpQBHgBC/devtools7bd510295c88/purrr'  \
  --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' --install-tests 

* installing *source* package ‘purrr’ ...
** package ‘purrr’ successfully unpacked and MD5 sums checked
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c backports.c -o backports.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c coerce.c -o coerce.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c extract.c -o extract.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c flatten.c -o flatten.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c map.c -o map.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c transpose.c -o transpose.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o purrr.so backports.o coerce.o extract.o flatten.o init.o map.o transpose.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.4/Resources/library/purrr/libs
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (purrr)

installGithub.r cache files?

When using installGithub.r in rocker containers, I noticed that multiple files were created in the /tmp directory.
This is not reproduced by Rscript -e "remotes::install_github()".

On r-base.

$ docker run --rm -it r-base bash

When use Rscript -e "remotes::install_github()":

root@47823eee5ec5:/# install2.r remotes
trying URL 'https://cloud.r-project.org/src/contrib/remotes_2.4.0.tar.gz'
Content type 'application/x-gzip' length 149836 bytes (146 KB)
==================================================
downloaded 146 KB

* installing *source* package ‘remotes’ ...
** package ‘remotes’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (remotes)

The downloaded source packages are in
        ‘/tmp/downloaded_packages’
root@47823eee5ec5:/# ls /tmp
downloaded_packages
root@47823eee5ec5:/# Rscript -e "remotes::install_github('eddelbuettel/drat')"
Downloading GitHub repo eddelbuettel/drat@HEAD
Running `R CMD build`...
* checking for file ‘/tmp/RtmpAlA2MX/remotes9c13132f72/eddelbuettel-drat-9b2cad6/DESCRIPTION’ ... OK
* preparing ‘drat’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘drat_0.2.1.tar.gz’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘drat’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (drat)
root@47823eee5ec5:/# ls /tmp
downloaded_packages

When use installGithub.r:

root@4e09517160b7:/# install2.r remotes
trying URL 'https://cloud.r-project.org/src/contrib/remotes_2.4.0.tar.gz'
Content type 'application/x-gzip' length 149836 bytes (146 KB)
==================================================
downloaded 146 KB

* installing *source* package ‘remotes’ ...
** package ‘remotes’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (remotes)

The downloaded source packages are in
        ‘/tmp/downloaded_packages’
root@4e09517160b7:/# ls /tmp
downloaded_packages
root@4e09517160b7:/# installGithub.r eddelbuettel/drat
Downloading GitHub repo eddelbuettel/drat@HEAD
Running `R CMD build`...
* checking for file ‘/tmp/remotes9c2944759f/eddelbuettel-drat-9b2cad6/DESCRIPTION’ ... OK
* preparing ‘drat’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘drat_0.2.1.tar.gz’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘drat’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (drat)
root@4e09517160b7:/# ls /tmp
downloaded_packages              libloc_180_a38f7d5813344af9.rds
file9c3de1eb8b                   remotes9c2944759f
libloc_169_8f48fc7d1db1bb3e.rds  repos_https%3A%2F%2Fcloud.r-project.org%2Fsrc%2Fcontrib.rds
libloc_174_173b0d0583319ed2.rds

I am having trouble deleting the files because they are not grouped in a single directory like /tmp/downloads_packages.
Can you give me any ideas?

Add installVersion.R script to install particular CRAN package versions

This is a feature request for the ability to specify versions for installed R packages. I am using the littler scripts in a Docker image, following the patterns I see in the rocker github organization, and would like the ability to pin installation versions so my builds are entirely predictable.

A question and possibly feature request

Hi

I am using littler to script automated pipeline processing using docker on an open stack vm on which linux is running. My main computer is a Mac. Now I have the problem, that the shebang in linux and Mac needs to be different.

I know that you like r and I did as well. But wouldn't it be possible to include an alias, e.g. lr which one could use on all OS?

I can do it manually, but would prefer (because of compatibility and reproducibility) an out-of-the-box solution.

Thanks,

Rainer

littler install2.r installs package dependencies in default?

Is there an official way to find the "suggested dependencies" of a package from CRAN for a package?
I am trying to build a container with rstan, and it appears that it installs quite a few dependencies, even with no flag set in my install2.r call:
https://github.com/eddelbuettel/littler/blob/master/inst/examples/install2.r

Running this, should show me the dependencies for a given package (please correct me if I am wrong) :

> tools::package_dependencies("rstan")
$rstan
[1] "ggplot2"     "StanHeaders" "methods"     "stats4"      "inline"     
[6] "gridExtra"   "Rcpp"        "RcppEigen"   "BH" 

However, when I install with the following dockerfile, I get quite a few more dependencies than what is listed:

FROM rocker/tidyverse:latest
RUN mkdir -p $HOME/.R
COPY R/Makevars /root/.R/Makevars

RUN apt-get update -qq \
    && apt-get -y --no-install-recommends install \
    liblzma-dev \
    libbz2-dev \
    ed \
    clang  \
    ccache \
    default-jdk \
    default-jre \
    && R CMD javareconf \
    && install2.r --error \
        ggstance ggrepel \
        rstan shinystan rstanarm \
        ###My pkgs
        tidytext janitor corrr officer devtools pacman
        tidyquant timetk tibbletime sweep broom prophet \
        forecast prophet lime sparklyr rsparkling \
        formattable httr rvest xml2 jsonlite \
        textclean ggthemes naniar \
    && Rscript -e 'devtools::install_github(c("hadley/multidplyr","jeremystan/tidyjson","ropenscilabs/skimr"))' \
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
    && rm -rf /var/lib/apt/lists/*

which yields this:


installing to /usr/local/lib/R/site-library/rstan/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (rstan)

The downloaded source packages are in
	‘/tmp/downloaded_packages’
also installing the dependencies ‘miniUI’, ‘PKI’, ‘RCurl’, ‘RJSONIO’, ‘packrat’, ‘crosstalk’, ‘bayesplot’, ‘colourpicker’, ‘DT’, ‘dygraphs’, ‘gtools’, ‘rsconnect’, ‘shinyjs’, ‘shinythemes’, ‘threejs’, ‘xts’

Even this CRAN site for the package(https://cran.r-project.org/web/packages/rstan/index.html) does not list these packages as dependencies, so is there something that I am missing to understand? Does compiling the package make more dependencies, or is it because of my what is in my dockerfile?

The one piece of this that is somewhat concerning is that even some of these other packages will state to install a dependency, but I can't seem to even verify that is needed:
Take Lime

installing to /usr/local/lib/R/site-library/lime/libs
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (lime)

The downloaded source packages are in
	‘/tmp/downloaded_packages’
also installing the dependencies ‘config’, ‘rappdirs’

Correct me if I'm wrong, but shoulden't once a package is installed, you should be see that it was installed successfully, not simply "the package installed, along with 5 other dependencies".

I guess this triggers a few questions for me:
-if Repo's is null, like in my case, does this attempt to pull the package from CRAN? Not exactly sure on default behaviour in the documentation

  • Does compiling the package make more dependencies because of compiling from source, or is it solely because of my what is in my dockerfile?
    -Do we need to be explicit about what CRAN portal to pull from in the install2.r
    -What is the best practice for checking pkg dependencies when using install2.r?
    -Is it possible to easily tell in the docker build file when a package builds successfully with it's dependencies? Or is this avail in a CI build tool to more easily navigate?

I have attached my full log for more details. The container does get successfully built with the script if you are wondering. Thanks for your time.

Terminal Saved Output_DockerfileRun.txt

Use littler to find and run an R script with arguments

Lets' say I have a package installed, within that package I have a script file that I need to run with arguments, but I don't always know where its installed.

I'd like to feed the results of R -e 'system.find("scripts","file.r",package="mypackage")' to Rscript such that it runs like:

Rscript result arg1 arg2 arg3 arg4 

Is that possible with littler?

Clean-up downloaded files

In Dockerfiles it's standard to use something like:

install2.r XXX \
  && rm -rf  /tmp/downloaded_packages/

Could we make this:

  • an option in install2.r, e.g. -c would run rm -rf after install

If you are amiable, then:

  • default of TRUE would be nice, but I realise that changes previous behaviour
  • would you like a PR?

More specific guidance on using littler with Mac OS

I realize that littler may not officially support Mac OS, but I would like to give it a try! I also know that some hints are given in the documentation as to how to use it with Mac OS, but these hints seems to expect a fair amount of systems knowledge.

Could you provide two sentences about how to try littler on the Mac?

My guess is that one needs to install it from source while simultaneously passing configure --program-prefix="l". I think that one should be able to do this by using the appropriate incantation on install.packages(), something like:

install.packages("littler", type = "source", configure.vars = c("--program-prefix='l'"))

That doesn't work, but I think that something close to that should. Any help much appreciated!

Has argv disappeared

Hi ,

I recently manually installed the latest littler and the following test case fails now

r -e 'print(dim(read.csv(argv[1],sep=" ",nrows=1)))' test/tmp.txt

ARGUMENT 'test/tmp.txt' __ignored__


R version 3.2.0 (2015-04-16) -- "Full of Ingredients"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

> print(dim(read.csv(argv[1],sep=" ",nrows=1)))
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  object 'argv' not found
Calls: print -> read.csv -> read.table
Execution halted


I have the default littler installed on Ubuntu 14.04 ( trusty ) and the following code works fine using
littler 0.1.5-1 .

ie:

r -V
r ('littler') version 0.1.5
        svn revision 185 as of 2011-09-17 09:35:56
        built at 09:13:01 on Oct 31 2011
        using GNU R Version 2.13.2 (2011-09-30)

Copyright (C) 2006 - 2011 Jeffrey Horner and Dirk Eddelbuettel


r is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License.  For more information about
these matters, see http://www.gnu.org/copyleft/gpl.html.

r -e 'print(dim(read.csv(argv[1],sep=" ",nrows=1)))' test/tmp.txt

[1]   1 667

Ncpus argument and install2.r

I don't think it's possible to use Ncpus with your neat install2.r script. Would you be open to a PR to include this functionality?

Unable to build release 0.2.3

https://aur.archlinux.org/packages/littler/

You didn't run bootstrap to make gitversion.h. Bootstrap can't make that file because the release version doesn't come with git info. The release version from Github and your website are both missing the file.
I pulled the necessary values out of the git history and it builds fine. The git version also builds fine.

#question: is it possible to use install2r to fech a tar from the working dir?

Hi there, I'm trying to create a customised docker image for my project based on rocker, but I'm running into trouble with openssl, libssl-dev etc.

I'm starting with rocker/devel and trying
install2.r --error --deps=TRUE \ -r 'http://cran.rstudio.com' \ -r 'http://datacube.wu.ac.at' \ -r 'http://packages.ropensci.org' \ -r 'http://www.bioconductor.org/packages/release/bioc' \ <!-- -r 'http://cran.ma.imperial.ac.uk/' \ --> <!-- -r 'https://github.com/jeroenooms/jsonlite' \ --> BH \ DBI \ NLP \ R6 \ Rcpp \ assertthat \ chron \ httpuv \ lazyeval \ slam \ tibble \ phylobase \ data.table \ dplyr \ jsonlite \ lubridate \ plumber \ stringr \ tm \ zoo

Can I set my local WORKDIR as an option in -r? Any workarounds?

Many thanks

Is littler intended to be compatible with R CMD INSTALL?

Hi,

I'm not an R user but currently setting up an R environment for a user. We're using NixOS (Linux) which provides a number of automatically packaged R packages based on CRAN. Our builder at some point runs:

$rCommand CMD INSTALL $installFlags --configure-args="$configureFlags" -l $out/library .
+ R CMD INSTALL --configure-args= -l /nix/store/mgbk39lm6i7xhwx9pzjpynzj8fpfjqy3-r-littler-0.3.3/library .

This breaks when CMD INSTALL does its check thing:

building path(s) ‘/nix/store/mgbk39lm6i7xhwx9pzjpynzj8fpfjqy3-r-littler-0.3.3’
|   executing builder ‘/nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/bash’
unpacking sources
unpacking source archive /nix/store/w3ish8b9my5k60llc6qig3vw1b9ij9rg-littler_0.3.3.tar.gz
source root is littler
setting SOURCE_DATE_EPOCH to timestamp 1513529959 of file littler/MD5
patching sources
configuring
building
running tests
installing
* installing *source* package 'littler' ...
** package 'littler' successfully unpacked and MD5 sums checked
checking for gcc... /nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0/bin/cc accepts -g... yes
checking for /nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0/bin/cc option to accept ISO C89... none needed
checking how to run the C preprocessor... /nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0/bin/cc -E
checking for grep that handles long lines and -e... /nix/store/9f89z51na7w931aja8lqlmhqny9h16cj-gnugrep-3.1/bin/grep
checking for egrep... /nix/store/9f89z51na7w931aja8lqlmhqny9h16cj-gnugrep-3.1/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking whether sys/types.h defines makedev... yes
checking for setenv... yes
checking for gettimeofday... yes
checking for time... yes
checking if R was built as a shared library... yes
checking for install_name_tool... no
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/gitversion.h
config.status: creating src/config.h
** libs
/nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0/bin/cc -o r -g -O2 -I/nix/store/ap80ym1qd41cbpk04makh9ja9k25cypc-R-3.5.1/lib/R/include littler.c  -Wl,--export-dynamic -fopenmp  -L/nix/store/ap80ym1qd41cbpk04makh9ja9k25cypc-R-3.5.1/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n -L/nix/store/blk28p4cr6r2nc7fi1c4gggiqpd7pkqy-openblas-0.3.1/lib -lopenblas -L/nix/store/blk28p4cr6r2nc7fi1c4gggiqpd7pkqy-openblas-0.3.1/lib -lopenblas -Wl,-rpath,/nix/store/ap80ym1qd41cbpk04makh9ja9k25cypc-R-3.5.1/lib/R/lib -Wl,-rpath,/nix/store/m8bp0zw93ci3fqlcw33sm2vznfq2rv1w-gfortran-7.3.0-lib/lib -Wl,-rpath,/nix/store/mvfh8jj5200308mv2wms2bnwzy96yi3c-gfortran-wrapper-7.3.0/bin -Wl,-rpath,/nix/store/gyrx9n14b3b8jm8zqsya36zjkqk0pgvg-gfortran-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0 -Wl,-rpath,/nix/store/gyrx9n14b3b8jm8zqsya36zjkqk0pgvg-gfortran-7.3.0/lib -Wl,-rpath,/nix/store/blk28p4cr6r2nc7fi1c4gggiqpd7pkqy-openblas-0.3.1/lib -Wl,-rpath,/nix/store/pay7xbyp76hp6kcp6achl24dd9dinp8z-tcl-8.6.6/lib -Wl,-rpath,/nix/store/mkvyrnrzzlx00r66w3sqfw8zavgw0bn0-tk-8.6.6/lib -Wl,-rpath,/nix/store/fc3pvx20j5hh3jpf6skjzdf50p2pph15-openjdk-8u192b26-jre/lib/openjdk/jre/lib/amd64/server -Wl,-rpath,/nix/store/ap80ym1qd41cbpk04makh9ja9k25cypc-R-3.5.1/lib/R/lib -Wl,-rpath,/nix/store/m8bp0zw93ci3fqlcw33sm2vznfq2rv1w-gfortran-7.3.0-lib/lib -Wl,-rpath,/nix/store/mvfh8jj5200308mv2wms2bnwzy96yi3c-gfortran-wrapper-7.3.0/bin -Wl,-rpath,/nix/store/gyrx9n14b3b8jm8zqsya36zjkqk0pgvg-gfortran-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0 -Wl,-rpath,/nix/store/gyrx9n14b3b8jm8zqsya36zjkqk0pgvg-gfortran-7.3.0/lib -Wl,-rpath,/nix/store/blk28p4cr6r2nc7fi1c4gggiqpd7pkqy-openblas-0.3.1/lib -Wl,-rpath,/nix/store/pay7xbyp76hp6kcp6achl24dd9dinp8z-tcl-8.6.6/lib -Wl,-rpath,/nix/store/mkvyrnrzzlx00r66w3sqfw8zavgw0bn0-tk-8.6.6/lib -Wl,-rpath,/nix/store/fc3pvx20j5hh3jpf6skjzdf50p2pph15-openjdk-8u192b26-jre/lib/openjdk/jre/lib/amd64/server -Wl,-rpath,/nix/store/ap80ym1qd41cbpk04makh9ja9k25cypc-R-3.5.1/lib/R/lib -Wl,-rpath,/nix/store/m8bp0zw93ci3fqlcw33sm2vznfq2rv1w-gfortran-7.3.0-lib/lib -Wl,-rpath,/nix/store/mvfh8jj5200308mv2wms2bnwzy96yi3c-gfortran-wrapper-7.3.0/bin -Wl,-rpath,/nix/store/gyrx9n14b3b8jm8zqsya36zjkqk0pgvg-gfortran-7.3.0/lib/gcc/x86_64-unknown-linux-gnu/7.3.0 -Wl,-rpath,/nix/store/gyrx9n14b3b8jm8zqsya36zjkqk0pgvg-gfortran-7.3.0/lib -Wl,-rpath,/nix/store/blk28p4cr6r2nc7fi1c4gggiqpd7pkqy-openblas-0.3.1/lib -Wl,-rpath,/nix/store/pay7xbyp76hp6kcp6achl24dd9dinp8z-tcl-8.6.6/lib -Wl,-rpath,/nix/store/mkvyrnrzzlx00r66w3sqfw8zavgw0bn0-tk-8.6.6/lib -Wl,-rpath,/nix/store/fc3pvx20j5hh3jpf6skjzdf50p2pph15-openjdk-8u192b26-jre/lib/openjdk/jre/lib/amd64/server
*
* new binary r installed in bin/ subdirectory
* consider adding a symbolic link from, e.g., /usr/local/bin
* on OS X, you may have to name this 'lr' instead
*
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for 'littler':
 .onAttach failed in attachNamespace() for 'littler', details:
  call: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE)
  error: error in running command
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/nix/store/mgbk39lm6i7xhwx9pzjpynzj8fpfjqy3-r-littler-0.3.3/library/littler'
note: keeping build directory ‘/tmp/nix-build-r-littler-0.3.3.drv-3’
builder for ‘/nix/store/f5hc9p8jp1jlibp1ksgng6ffyrn660xk-r-littler-0.3.3.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/xjm7kk53b61qhvpx1ndnrlzvbmp5rddp-R-3.5.1-wrapper.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/z5bx816hr47sizwdglv7yx4zmxlk4wa1-blackbee-wfe-1.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/z5bx816hr47sizwdglv7yx4zmxlk4wa1-blackbee-wfe-1.drv’ failed

Looking at the resulting R environment seems like it's working so far, but I guess this might be some incompatibility between the R CMD INSTALL invocation and running it with --no-test-load turns out fine.

So my question is: is this an build procedure thats supposed to be working and we have something weird in our setup or is this known to not work and running with --no-test-load is working as intended?

Execute .First() from .Rprofile

Hi Dirk,

I remember that you mentioned that sourcing the .Rprofile is quite a task at the C-level.
Therefore thank you very much having introduced this very useful feature (201a83a) now!

Is it possible that littler also runs the function .First() from .Rprofile at startup?

This happens when calling R|Rscript|R CMD BATCH, for example, so that

r -e 'cat(.libPaths(),"\n")'
/opt/share/software/packages/R-3.2.0/lib64/R/library 

acts similar to

r -e '.First(); cat(.libPaths(),"\n")'
/home/templer/.local/lib/R/3.2 /opt/share/software/packages/R-3.2.0/lib64/R/library 

provided one modifies the library paths within .First().

Best,
Sven.

clang: error: unsupported option '-fopenmp'

I'm getting an error while trying to install littler on Mac. Specifically clang: error: unsupported option '-fopenmp'. Any idea what's going on here? I'm surprised that littler would be trying to use openmp! Here's the full console output (let me know if I can provide any other debugging information):

$ R

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("littler")

Package which is only available in source form, and may need
  compilation of C/C++/Fortran: ‘littler’
Do you want to attempt to install these from sources? (Yes/no/cancel) 
installing the source package ‘littler’

trying URL 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/littler_0.3.11.tar.gz'
Content type 'binary/octet-stream' length 654953 bytes (639 KB)
==================================================
downloaded 639 KB

* installing *source* package ‘littler’ ...
** package ‘littler’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking whether sys/types.h defines makedev... yes
checking for setenv... yes
checking for gettimeofday... yes
checking for time... yes
checking if R was built as a shared library... yes
checking for install_name_tool... /usr/bin/install_name_tool
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/gitversion.h
config.status: creating src/config.h
** libs
clang -o r -Wall -g -O2 -I/Library/Frameworks/R.framework/Resources/include littler.c -L/usr/local/lib -fopenmp -L/usr/local/lib -F/Library/Frameworks/R.framework/.. -framework R -lpcre -llzma -lbz2 -lz -licucore -ldl -lm -liconv -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/Library/Frameworks/R.framework/Resources/lib -lRlapack 
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
make: *** [r] Error 1
ERROR: compilation failed for package ‘littler’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/littler’

The downloaded source packages are in
	‘/private/var/folders/88/6s9dyd8x3438m3fk7r3240c910v55q/T/RtmprXnVZL/downloaded_packages’
Warning message:
In install.packages("littler") :
  installation of package ‘littler’ had non-zero exit status

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.