Re: [Rd] Re: Compiler-specific flags with PKG_CFLAGS

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Thu 10 Feb 2005 - 05:56:30 EST

On Feb 9, 2005, at 12:21 PM, Paul Roebuck wrote:

> On Wed, 9 Feb 2005, Kurt Hornik wrote:

>> I think the simplest way to achieve this is to configure R
>> locally (for yourself) with CFLAGS="-O2 -Wall -pedantic" but
>> leave the corresponding PKG_CFLAGS etc variables in package
>> src/Makevars alone.
> I can do that for workstations which I have admin priviledges > and have a private version of R; how about the ones I don't? I don't get your point - if you are not admin and don't use your own R version, how do you expect to change behavior of the R you don't have write access to? You can't, as admin doesn't want you to. This still doesn't prevent you from compiling the package for yourself in your home, including any flags you like. R allows you to change whatever you like for the package you compile.
Adding such flags as above in the package itself doesn't make any sense IMHO, as you should expect that whatever flags R was compiled with were specifically provided to steer optimizations etc. There are platform/compiler version combinations where -O2 breaks numerical computations, so overriding this for your package will override a choice which was done deliberately and you're not even aware of. In addition -Ox may have been specified already, so you may in fact downgrade the optimizations. At the time of compilation of the package the user is free to override any flags, so he can do so if he knows what he's doing. The current approach is good at preventing the user from doing bad things by default and producing consistent code. What Kurt mentioned was just a way to reduce typing effort (and achieve more consistency) when specifying flags for packages you compile for yourself - you're still responsible for the content of the files you put there, so it's up to you to be aware of the issues you mentioned - R can't do that for you. You get what you tell R to do - there is no automatic protection against misuse ;).
Cheers,
Simon

R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Feb 10 05:16:32 2005

This archive was generated by hypermail 2.1.8 : Thu 10 Feb 2005 - 05:27:03 EST