From hin-tak.leung at cimr.cam.ac.uk  Wed May 10 12:56:11 2006
From: hin-tak.leung at cimr.cam.ac.uk (Hin-Tak Leung)
Date: Wed, 10 May 2006 11:56:11 +0100
Subject: [Rd] suppressing "global" cppflags in an individual package
In-Reply-To: <8315342E-192B-4BF4-86BC-8F947769530E@stat.Berkeley.EDU>
References: <9294B498-A4DB-47B1-AE99-71C1559EABB3@stat.berkeley.edu>
	<4460C819.6090407@cimr.cam.ac.uk>
	<8315342E-192B-4BF4-86BC-8F947769530E@stat.Berkeley.EDU>
Message-ID: <4461C6CB.7040602@cimr.cam.ac.uk>

Kasper Daniel Hansen wrote:
<snipped>
> It is indeed the case that after updating to GCC 4 the package gets 
> broken using -O2. I agree this needs to be fixed, but the error (which I 
> believe I have kind of localized, but not really understood) stems from 
> a C++ library we have little control over, so it would be nice to have a 
> fix for the time being that does not require a reinstallation of R - 
> especially since we actually have users who currently (or soon will be) 
> testing it. I was thus looking for a temporary quick fix allowing me to 
> disable the optimization level, while I take the time to fix it properly.
> 
> Kurt Hornik have replied of-list that it is possible to do so using a 
> ~/.R/Makevars file (which I have not had the time to test 
> unfortunately), but reading your comment about CPPFLAGS and CXXFLAGS 
> makes me think I can indeed override it using the package Makevars file. 
> The flags I was passing to the compiler were library locations anyway 
> which was for the preprocessor.

Can't do that with Makevars, because its defines are included first (and 
get overriden by R's built-time flags later in the command line), as 
Simon on the list has pointed out.

If it is a one-off operation, you can be slightly barbaric and just
record all the operations done by R CMD SHLIB/INSTALL
e.g. piping them to a file with >& , edit the file manually and exec
the operations by "sh file", then copy the differently-built shared
library over by hand, over-writing the broken one. Not very elegant,
but it will buy you some time until either the compiler or the package 
get fixed.

Hin-Tak Leung



[Rd] suppressing "global" cppflags in an individual package
Hin-Tak Leung