[R] Summary on Usage of R CMD INSTALL

Kurt Hornik Kurt.Hornik at ci.tuwien.ac.at
Tue Jul 31 12:28:03 CEST 2001

>>>>> "David Kane writes:

> Thanks to Tim Hoar and Kurt Hornik for taking the time to answer my question
> about the usage of R CMD INSTALL. Tim suggested:

>> R CMD INSTALL --configure-args=--with-netCDF=/opt/local/netcdf-3.5.0 netCDF

>> no quotes at all, no spaces ...

> Kurt wrote:

>> R CMD INSTALL --configure-vars='LIBS=-L/mylibs' mypackage

> Alas, I am not smart enough to know whether there is a contradiction
> between these two suggestions. My goal was to install the RODBC
> library in a situation in which we have libraries and other things in
> non-standard places.

Some add-on packages have provided configure options for specifying the
non-standard locations of libraries and headers.  This is nice, but
means that you have to know what these package-specific options (e.g.,
`--with-netCDF=' in the above) are called, which is complicated and not
really along the lines of Plug-and-Play installation.  Hence, we have
added the `--configure-vars' mechanism which allows you to do

  --configure-vars='LIBS=-L/path/to/libs CPPFLAGS=-I/path/to/headers'

> In the end, a system-savy friend succeeded in this. He reports:

>> The problem was that the the shell script wrapping called by 
>> R CMD INSTALL called "SHLIB" was not allowing environment variables
>> set in the executing shell to be used in the "${MAKE}" call. The fix 
>> was to temporarily change the call in SHLIB to "${MAKE} -e" to force it 
>> use the external environment variables. RODBC is a package that needs
>> several external variables to be set and the --configure-vars or
>> --configure-args options seem to be ineffective in trying to set
>> this library up.

>> Perhaps there is an easier way to get it done via some combination of 
>> --configure-args and/or --configure-vars that someone has found to 
>> work with RODBC. I have tried many different combinations but cannot
>> say that I've tried all combinations.

>> Anyway, the above remedy works and it installs RODBC into R.

> Again, I don't know if this work-around is an indication of problems
> with 1) my understanding of R CMD INSTALL and/or RODBC and/or UNIX; 2)
> R CMD INSTALL or 3) RODBC. I certainly agree with Kurt's suggestions
> that there should be more documentation/pointers on these issues. I
> offer the above in the hope that someone benefits from it.

I am not sure what is system-savvy about this.  If what is intended and
documented does not work, it is a bug, and should be reported as such.
There is really no point in advocating a non-portable ($MAKE -e) and
temporary solution.

Re RODBC, assume you had libiodbc in a non-standard place, say
e.g. `/home/me/lib'.  Then you should be able to do

	  --configure-vars='-L/home/me/lib' /path/to/RODBC

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list