[R] choosing g/g++ compiler executable in R CMD SHLIB

Kurt Hornik Kurt.Hornik at ci.tuwien.ac.at
Sun Nov 18 20:18:41 CET 2001

>>>>> Prof Brian D Ripley writes:

> On Sat, 17 Nov 2001, Faheem Mitha wrote:

>> Just one more question. Is it possible to override ../etc/Makeconf
>> locally, in the directory in which I am doing the complilation? I can use
>> Makevars to set flags, but it doesn't seem to work with choosing the
>> compiler. Ie setting CC=.. in Makevars has no effect.

> I believe that is intentional.  Neither setting CC in the environment nor
> in Makevars works for me.  Makevars precedes the standard makefile.
> I did make setting CC in the environment work by setting MAKE to `gmake
> -e', as in (under tcsh)

> auk% env MAKE='gmake -e' CC=cc R CMD SHLIB test.c

This is actually an FAQ:

How can I change compilation flags?

   Suppose you have C code file for dynloading into R, but you want to
use `R CMD SHLIB' with compilation flags other than the default ones
(which were determined when R was built).  You could change the file
``R_HOME'/etc/Makeconf' to reflect your preferences.  If you are a
Bourne shell user, you can also pass the desired flags to Make (which
is used for controlling compilation) via the Make variable `MAKEFLAGS',
as in


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