[Rd] bnlearn package compilation failure on MacOSX

Simon Urbanek simon.urbanek at r-project.org
Thu Oct 4 23:32:48 CEST 2007


Marco,

On Oct 4, 2007, at 2:05 PM, Marco Scutari wrote:

> I've recently uploaded a package (bnlearn) to CRAN. It builds fine  
> on both Linux (32 and 64 bit) and Windows, but fails on MacOSX ix86  
> because of C90 vs C99 issues:
>
> http://www.r-project.org/nosvn/R.check/r-patched-macosx-ix86/ 
> bnlearn-00install.html
>
> Since I've no MacOSX machine at hand, I would like to ask you: why  
> is C99 not the default for gcc on MacOSX ix86?


It was not deliberate. The current R build (R 2.6.0) was modified to  
use -std=gnu99 in the CC section for both architectures instead of  
using CFLAGS, that should solve the problem. A work around for older  
R is to set PKG_CFLAGS=-std=gnu99 when installing bnlearn.

However, note that C99 compiler is not required for R so it may not  
be available. Since you don't really need any advanced functionality  
of C99, it may be a good idea to change it to a more portable C code.


> Is it safe to force gcc to use C99 with either -std=c99 o -std=gnu99?
>

Not in your package as cannot assume gcc in general, but temporarily  
for R 2.5.1 on OS X, yes.

Thanks,
Simon



More information about the R-devel mailing list