Skip to content
Prev 20562 / 63421 Next

suppressing "global" cppflags in an individual package

Kasper Daniel Hansen wrote:
Do you mean the flags passed to the c++ compiler (CXXFLAGS) or
to the C proprocessor (CPPFLAGS)? Do not confuse the two.

I think the "proper" way would be to write a full makefile.
(there are plenty of examples on CRAN).

Now, out of curiosity - why would you want to do that? The actual 
difference in CPU time usage is often small (10%?), so unless the
package triggers a compiler bug at specific optimization level and
gets mis-compiled, it is probably not worth the trouble. And if
the package is that sensitive to optimization level and can get 
mis-compiled, one of them (the package or the compiler) needs fixing.

HTL