On 09/14/2011 10:18 AM, Andrew Piskorski wrote:
Today I built R from source on a 32-bit Ubuntu 10.04.3 LTS box, and
saw that the "make check" tests/reg-tests-1b.R failed. From the
output at the end of my "tests/reg-tests-1b.Rout.fail" file, the
problem is appearing in the "identical(z, x %*% t(y))" test code
below.
I then tried the stock R provided by the Ubuntu r-base-core binary
package, and to my surprise, it failed the test in exactly the same
way!
So this is NOT solely a problem with my from-source build (I merely
happened to notice it first that way). It probably indicates some
sort of system-wide bug or misconfiguration, at least on my machine,
perhaps on others' too.
Could someone please advise me: What is the significance of this test
from reg-tests-1b.R failing, and what should I do to further track it
down and fix it?
Thanks! Much more detail is below.
------------------------------------------------------------
# Here's the excerpt from the "make check" output where I first
# noticed the problem:
running regression tests ...
make[3]: Entering directory
`/net/brain/home/local-x86_32-ubuntu/nobackup/co-R/R-2-12-branch/Build-x86_32/tests'
running code in '../../tests/reg-tests-1.R' ... OK
running code in '../../tests/reg-tests-1b.R' ...make[3]: ***
[reg-tests-1b.Rout] Error 1
make[3]: Leaving directory
`/net/brain/home/local-x86_32-ubuntu/nobackup/co-R/R-2-12-branch/Build-x86_32/tests'
make[2]: *** [test-Reg] Error 2
make[2]: Leaving directory
`/net/brain/home/local-x86_32-ubuntu/nobackup/co-R/R-2-12-branch/Build-x86_32/tests'
make[1]: *** [test-all-basics] Error 1
make[1]: Leaving directory
`/net/brain/home/local-x86_32-ubuntu/nobackup/co-R/R-2-12-branch/Build-x86_32/tests'
make: *** [check] Error 2
# This is the Ubuntu machine where I found the error:
andy@n88:~$ lsb_release -d
Description: Ubuntu 10.04.3 LTS
andy@n88:~$ uname -a
Linux n88 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686
GNU/Linux
andy@n88:~$ dpkg -l r-base-core | grep r-base
ii r-base-core 2.10.1-2 GNU R core of statistical computation and graphics
system
# Stock Ubuntu-provided R has the same failure:
andy@n88:~$ /usr/bin/R -q --vanilla
dtk.R.version()
[1] "R 2.10.1, 2009-12-14, svn.rev 50720, i486-pc-linux-gnu"
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
identical(z, x %*% t(y))
[1] FALSE
# R I just built from scratch, same failure as stock R:
andy@n88:~$ /usr/local/pkg/R-2.12-branch-20110914/bin/R -q --vanilla
dtk.R.version()
[1] "R 2.12.2 (Patched), 2011-03-18, svn.rev 57004, i686-pc-linux-gnu"
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
identical(z, x %*% t(y))
[1] FALSE
# Apparently the correct output is supposed to look like this:
andy@dax:~$ /usr/bin/R -q --vanilla
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 NA
[2,] 2 1 0
identical(z, x %*% t(y))
[1] TRUE
# Note that the correct output above was run on a different machine,
# which happens to be x86-64:
andy@dax:~$ lsb_release -d
Description: Ubuntu 10.04.3 LTS
andy@dax:~$ uname -a
Linux dax 2.6.32.29+drm33.13-custom #1 SMP Fri Apr 8 13:42:18 EDT 2011 x86_64
GNU/Linux
# Function I used to print out the version number info above:
dtk.R.version<- function() {
patched.str<- version$status
if (patched.str != "")
patched.str<- paste(" (" ,patched.str ,")" ,sep="")
paste(paste(version$language ," "
,paste(version[c("major","minor")] ,collapse=".")
,patched.str ,sep="")
,paste(version[c("year","month","day")] ,collapse="-")
,paste("svn.rev" ,version$"svn rev")
,version$platform
,sep=", " ,collapse=" ")
}
On my i386 machine:
~/D/R> lsb_release -d
Description: Ubuntu 10.04.3 LTS
I get the following:
> dtk.R.version()
[1] "R 2.13.1, 2011-07-08, svn.rev 56322, i486-pc-linux-gnu"
> x <- matrix(c(1, 0, NA, 1), 2, 2)
> y <- matrix(c(1, 0, 0, 2, 1, 0), 3, 2)
> (z <- tcrossprod(x, y))
> identical(z, x %*% t(y))
[,1] [,2] [,3]
[1,] NA NA NA
[2,] 2 1 0
[1] TRUE
This is using the R available on CRAN. I can think of two possible causes:
1. It is an error that was found prior to 2.13.1 and has been fixed.
2. You have installed a non-standard, math-related library on your
machine that is causing the error. A LAPACK library or the Revolution
computing libraries available in Ubuntu are examples.
To test, I downgraded my R back to 2.10.1-2, the version from Ubuntu,
not from CRAN. Here are my results:
> 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 NA
[2,] 2 1 0
> identical(z, x %*% t(y))
[1] TRUE
> dtk.R.version()
[1] "R 2.10.1, 2009-12-14, svn.rev 50720, i486-pc-linux-gnu"
This leads me to believe cause number 2 is the likely culprit.
Michael
--
Dr. Michael A. Rutter
School of Science
Penn State Erie, The Behrend College
Station Road
Erie, PA 16563
http://math.bd.psu.edu/faculty/rutter
_______________________________________________
R-SIG-Debian mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-debian