tub78
2008-Jun-04 04:35 UTC
[R] "ignoring environment value of R_HOME" error when installing packages
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. - Here are lines 29-32 from <R_HOME>/bin/R: if test -n "${R_HOME}" && \ test "${R_HOME}" != "${R_HOME_DIR}"; then echo "WARNING: ignoring environment value of R_HOME" fi - Here is line 606 of <R_HOME>/bin/INSTALL: CLINK_CPPFLAGS=`echo "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? Thanks, - Stu
tub78
2008-Jun-04 21:40 UTC
[R] "ignoring environment value of R_HOME" error when installing packages
This bug has been resolved, after our administrator updated the path of R_HOME in our scripts. I believe that the cause of trouble was the parallel nature of the installation, as mentioned in the following thread: http://groups.google.com/group/r-help-archive/browse_thread/thread/632175125a7c4 16f/6a5220b73d3ac682?lnk=gst&q=R_HOME# regards - S. On Jun 4, 12:35?am, tub78 <stu.andr... at gmail.com> wrote:> 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. > > - Here are lines 29-32 from <R_HOME>/bin/R: > > if test -n "${R_HOME}" && \ > ? ?test "${R_HOME}" != "${R_HOME_DIR}"; then > ? echo "WARNING: ignoring environment value of R_HOME" > fi > > - Here is line 606 of <R_HOME>/bin/INSTALL: > > ? ? CLINK_CPPFLAGS=`echo > "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? > > Thanks, > - Stu > > ______________________________________________ > R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.