[R] Build fails for R 1.6.2: [base-Ex.Rout] Error 1

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Apr 8 22:36:29 CEST 2003


Thomas Lumley <tlumley at u.washington.edu> writes:

> On Tue, 8 Apr 2003, Christopher Fonnesbeck wrote:
> 
> > I am trying to build 1.6.2 from source RPM's on RedHat 9, but encounter
> > a failure when running the base tests. An inspection of
> > base-Ex.Rout.fail reveals the following:
> >
...
> Yes. The version of gcc in RedHat 9 will not distinguish NA and NaN at
> least sometimes, when optimization is used.  The bug report for RedHat is
> at
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=88174
> 
> A fix has been added to the development version of R.

Well, let's call it a workaround. The fix is gcc 3.3.

...but it's a one-liner: Inside the 

static double R_ValueOfNA(void)

in src/main/arithmetic.c

declare x volatile, i.e.

static double R_ValueOfNA(void)
{
    /* The gcc shipping with RedHat 9 gets this wrong without
     * the volatile declaration. Thanks to Marc Schwartz. */
    volatile ieee_double x;
    x.word[hw] = 0x7ff00000;
    x.word[lw] = 1954;
    return x.value;
}


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-help mailing list