[R] g++ error causes non-zero exit status for package installation

Henrik Bengtsson henrik@bengt@@on @ending from gm@il@com
Sat Jan 5 22:13:25 CET 2019


On Sat, Jan 5, 2019 at 9:41 AM Dirk Eddelbuettel <edd using debian.org> wrote:
>
>
> On 5 January 2019 at 09:14, William Dunlap via R-help wrote:
> | You would get these errors ("R: file or directory not found, version: file
> | or directory not found...") if you had a ~/.Rprofile file containing the
> | line 'cat(version$version.string, sep="\n").
>
> Well spotted -- very much so. That is bound to break use within src/Makevars
> and alike. If you must do something in ~/.Rprofile either make it silent, or
> make it conditional based on if (interactive()) { ...that_code_here... }

Interesting problem.  One way to workaround this startup issue with:

  PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`

used by minqa:src/Makevars
(https://r-forge.r-project.org/scm/viewvc.php/pkg/minqa/src/Makevars?view=markup&root=optimizer),
could be to use something like:

  PKG_LIBS = `Rscript -e "cat('LDFLAGS:\n')" -e "Rcpp:::LdFlags()" |
grep -A 999 "LDFLAGS:" | grep -v "LDFLAGS:"`

and analogously for src/Makevars.win.

But in the bigger picture, maybe there's room for an R/Rscript option
to silence all R startup stdout and/or stderr output?  For example,

  Rscript --quiet-startup -e "Rcpp:::LdFlags()"`

/Henrik

PS. It's probably better to output to stderr in .Rprofile, e.g. by
always using message() instead of cat(). However, that cannot be
assumed to always be the case.

>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list