[R] "ignoring environment value of R_HOME" error when installing packages

From: tub78 <stu.andrews_at_gmail.com>
Date: Tue, 03 Jun 2008 21:35:41 -0700 (PDT)

I am troubled by what appears to be a glitch in the current distribution, or in
its installation on our system. I've traced it, and found a work- around. Is
this normal? Is there a cleaner solution?

The problem:

During a package installation, the warning message "WARNING: ignoring environment value of R_HOME" from line 31 of <R_HOME>/bin/R is accidentally
spliced into the CLINK_CPPFLAGS variable at line 606 of <R_HOME>/bin/ INSTALL.
This prevents the compilation C files. Please note that I have not set the R_HOME
environment variable; it is undefined in my shell.

if test -n "${R_HOME}" && \

   test "${R_HOME}" != "${R_HOME_DIR}"; then   echo "WARNING: ignoring environment value of R_HOME" fi

"tools:::.find_cinclude_paths(file='DESCRIPTION')" | \

      "${R_EXE}" --vanilla --slave`

The work-around:

First some background. The command sequence "R CMD INSTALL" sets in motion a sequence of scripts that collectively manage the installation process.

    "R" <R_HOME>/bin/R calls Rcmd script on line 148

    "CMD" <R_HOME>/lib/R/bin/Rcmd calls INSTALL script on line 45

    "INSTALL" <R_HOME>/lib/R/bin/INSTALL encounters the error on line 606

Now, if you are the owner of you installation, then you can probably just edit
the INSTALL file directly.

Otherwise, if you specify the full path of an executable in place of the word
"INSTALL" on the command line, the Rcmd script will detect this and call your
script instead of the normal INSTALL script (see Rcmd line 37).

    e.g. "R CMD <path.to.alternate.install.script> ..."

One can just copy the INSTALL script, changing line 606 to CLINK_CPPFLAGS = ""
and hope for the best. If the package you are compiling specifies its own C
include files, then you will have to modify the variable accordingly, or else
use the ~/.R/Makevars mechanism.

But, the question remains, is there an nicer solution?

- Stu

R-help_at_r-project.org mailing list
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. Received on Wed 04 Jun 2008 - 07:10:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jun 2008 - 00:30:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive