R with a broken finite() (was [R] Problems with R-0.65.0) (PR#275)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Tue, 14 Sep 1999 16:18:08 +0200 (MET DST)

[Copied to R-bugs so it goes into the database.]

On Mon, 13 Sep 1999, Ralf Herbrich wrote:

> Hello,
> I installed the new release 0.65.0 of R on our local Solaris system. As I
> already (and sucessfully) installed the 0.64.0 and 0.64.1 version of R, I
> hadn't had any trouble during the installation. But as I've started R in
> order to see the demo I've got horizontal and vertical lines goint to the
> left and top of the X11 window at each tick (demo ("graphics")). This
> seems not to be a grid but is now standard in any 2D plot (I also tried
> several of my own R programs). Furthermore, the exported postscripts
> (dev.print (file="blabla.ps")) can't be displayed by ghostscript.
> What did I wrong during the installation?

To follow up on this, Ralf was using Solaris 2.6 and 

gcc version egcs-2.91.63 19990224 (egcs-1.1.2 pre-release-3)

which is probably not a good idea, being an old pre-release (gcc 2.8.1,
real egcs-1.1.2 and gcc-2.95.1 have all been tried).  This reported that
calloc and finite are broken on Solaris 2.6, and they are not on other
systems, so it seems more likely that the compiler is broken.

If you find a system with HAVE_FINITE and FINITE_BROKEN defined, then R
will not work correctly (unless it uses the AIX workaround). The fix I
suggested to Ralf worked, and will probably be incorporated in 0.65.1
(unless we find a better one).

Try replacing the line

#   define R_FINITE(x)          ((x) != R_NaReal)

in Arith.h by

static int R_FINITE(double x) {
    return !isnan(x) & (x != R_PosInf) & (x != R_NegInf); }

Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch