From pdalgd at gmail.com  Wed Nov 16 23:04:45 2011
From: pdalgd at gmail.com (peter dalgaard)
Date: Wed, 16 Nov 2011 23:04:45 +0100
Subject: [Rd] cygwin R-2.14.0 build fail
In-Reply-To: <4EC42656.6010704@gmail.com>
References: <1321107923.21160.YahooMailNeo@web27002.mail.ukl.yahoo.com>
	<4EC3D2BD.8070008@gmail.com>
	<alpine.LFD.2.02.1111162027520.28593@gannet.stats.ox.ac.uk>
	<4EC42656.6010704@gmail.com>
Message-ID: <5B230290-335A-4825-9C2A-D30E54028A43@gmail.com>


On Nov 16, 2011, at 22:08 , marco atzeri wrote:

> On 11/16/2011 9:32 PM, Prof Brian Ripley wrote:
>> The failures are *not* minor. Please don't distribute an R linked to a
>> broken BLAS library. Those tests are not for fun: they came from real
>> errors on real problems.
>> 
> 
> Dear Brian,
> I am reasonable sure that the cygwin blas library are fine, have
> you any evidence that they are broken ?
> 
> The R test log just reports an issue handling NA that could be
> related to cygwin difference to others platform.
> I already noted similar difference on cygwin octave package.
> 


Well, on other platforms we have

> tcrossprod(x,y)
     [,1] [,2] [,3]
[1,]   NA   NA   NA
[2,]    2    1    0
> x %*% t(y)
     [,1] [,2] [,3]
[1,]   NA   NA   NA
[2,]    2    1    0

so the Cygwin tcrossprod is implicitly letting 0*NA==0 (in the DGEMM BLAS routine). 

This is not what should happen according to the standards, and there are people whose code relies on standards compliance (and that's why the test is there).

It's also plain wrong, because in extended arithmetic, the missing value could be Inf, and 0*Inf == NaN, so assuming that 0*anything==0 doesn't work.

-pd

> Here is the log:
> --------------------------------------------------
> > ## PR#4582 %*% with NAs
> > stopifnot(is.na(NA %*% 0), is.na(0 %*% NA))
> > ## depended on the BLAS in use.
> >
> >
> > ## found from fallback test in slam 0.1-15
> > ## most likely indicates an inaedquate BLAS.
> > x <- matrix(c(1, 0, NA, 1), 2, 2)
> > y <- matrix(c(1, 0, 0, 2, 1, 0), 3, 2)
> > (z <- tcrossprod(x, y))
>     [,1] [,2] [,3]
> [1,]   NA   NA    0
> [2,]    2    1    0
> > stopifnot(identical(z, x %*% t(y)))
> Error: identical(z, x %*% t(y)) is not TRUE
> Execution halted
> tests/reg-BLAS.Rout.fail (END)
> --------------------------------------------------
> 
> Regards
> Marco
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] cygwin R-2.14.0 build fail
peter dalgaard