[R] Build fails for R 1.6.2: [base-Ex.Rout] Error 1
Marc Schwartz
mschwartz at medanalytics.com
Tue Apr 8 23:12:22 CEST 2003
Peter Dalgaard BSA wrote:
> 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;
> }
>
I can verify that the above change does work for R 1.6.2 and passes make
check under RH 9.
Chris, download the source tar file from CRAN and as Peter has pointed
out, make the change in line 119 in arithmetic.c. Then:
./configure
make
make check
make install
HTH,
Marc Schwartz
More information about the R-help
mailing list