[Rd] further f77/gfortran

Kasper Daniel Hansen khansen at stat.Berkeley.EDU
Wed Jun 7 21:05:02 CEST 2006


On Jun 7, 2006, at 10:22 AM, Dirk Eddelbuettel wrote:

>
> On 7 June 2006 at 17:29, Prof Brian Ripley wrote:
> | > That came up recently:
> | >
> | > a)  ~/.Makevars  (as I recall)
> |
> | ~/.R/Makevars, but that applies to all packages on all builds.
>
> Yes indeed. Thanks for catching and correcting this.
>
> | > b)  on a per invocation basis:
> | > 	MAKEFLAGS="FFLAGS=-O1" R CMD INSTALL ...
> | >    is something that worked for me.
> |
> | Yes, but it only works in some Makes, including GNU Make.
> |
> | > That said, I personally still dislike that I cannot 'undo' the  
> settings the
> | > R's global Makeconf.  I'd love to turn debugging,  
> optimisation, ... on/off on
> | > demand.
> |
> | It might make sense to separate CFLAGS, FFLAGS, CXXFLAGS, FCFLAGS  
> out of
> | etc/Makeconf into a Makefile included before Makevars.  But I am  
> very
> | reluctant to make it easy to change the F77 compiler or FLIBS or
> | FPICFLAGS.
>
> Well, as that would cover my past needs (where on certain  
> architectures we
> had switch from -O2 to a lower optimisation setting or g77 would die;
> obviously a g77 bug and now mostly (?) fixed) so I'd say yes.
>
> Not hugely pressing as the current system has worked, but I would  
> at certain
> points in the past have like to have this available.

I would really like the ability to override the optimization flags on  
a per package basis. I have a use case where I am using an SDK  
outside of my control which does not work with -O2 on (some versions  
of) GCC. From Dirk's description it seems I am not alone in having  
this problem. From my point of view it is unreasonable to make a user  
build R with specific optimization flags just because of a single  
package (especially if one wants to distribute the package to many  
users). I guess what I am trying to articulate is that I see this as  
a potential useful ability to have.

Right now I am using a hack by Simon Urbanek posted to R-devel some  
time ago which basically reverses the order of PKG_CXXFLAGS and  
CXXFLAGS, allowing me to override the R supplied ones. I know this is  
not portable since -O* is not a common to all compilers.

I am thinking of something like PKG_CXXSAFEFLAGS which - if set -  
will override the CXXFLAGS set by etc/Makeconf. Then I should be able  
to do something like (pseudo code)
   if using(gcc)
     set PKG_CXXSAFEFLAGS=....
I am not sure whether this is feasible, because I am only really  
interested in overriding the optimization flags and not all the other  
CXXFLAGS.

Unfortunately, my knowledge of Makefiles and configure scripts do not  
make it possible to come up with a specific suggestion - only a use  
case and a wish :)

/Kasper



> Dirk
>
>
> -- 
> Hell, there are no rules here - we're trying to accomplish something.
>                                                   -- Thomas A. Edison
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list