Hi all. 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? Is it safe to force gcc to use C99 with either -std=c99 o -std=gnu99? Thanks in advance. -- Marco Scutari Linux Registered User #341807 http://counter.li.org powered by : Debian Sid GNU/Linux (SGI-XFS) Kernel 2.6.21.3
Prof Brian Ripley
2007-Oct-04 18:51 UTC
[Rd] bnlearn package compilation failure on MacOSX
You've got more serious problems than that: you cannot assume gcc. For example on the SunPro compiler I got cc -I/home/ripley/R/R-devel-SunPro/include -I/home/ripley/R/R-devel-SunPro/inclu de -I/usr/local/include -Kpic -xO5 -xc99 -xlibmil -nofstore -c mutual.infor mation.c -o mutual.information.o "mutual.information.c", line 34: member can not have variably modified type: n "mutual.information.c", line 35: member can not have variably modified type: m "mutual.information.c", line 41: cannot dereference non-pointer type "mutual.information.c", line 52: cannot dereference non-pointer type "mutual.information.c", line 52: cannot dereference non-pointer type "mutual.information.c", line 53: cannot dereference non-pointer type "mutual.information.c", line 53: cannot dereference non-pointer type "mutual.information.c", line 54: cannot dereference non-pointer type "mutual.information.c", line 54: cannot dereference non-pointer type "mutual.information.c", line 60: warning: improper pointer/integer combination: arg #5 "mutual.information.c", line 62: cannot recover from previous errors Note that is in C99 mode, and under Linux. On Thu, 4 Oct 2007, Marco Scutari wrote:> > Hi all. > > 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? Is it safe to > force gcc to use C99 with either -std=c99 o -std=gnu99? > > Thanks in advance. > > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
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