From ripley at stats.ox.ac.uk  Thu Oct  4 20:51:26 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 4 Oct 2007 19:51:26 +0100 (BST)
Subject: [Rd] bnlearn package compilation failure on MacOSX
In-Reply-To: <20071004180536.GA2993@elhalyn>
References: <20071004180536.GA2993@elhalyn>
Message-ID: <Pine.LNX.4.64.0710041945010.5059@gannet.stats.ox.ac.uk>

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



[Rd] bnlearn package compilation failure on MacOSX
Prof Brian Ripley