[Rd] Trying to compile R 4.2.x on Linux as 32bit sub-architecture
Martin Maechler
m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Mon Jun 20 15:35:34 CEST 2022
>>>>> Berwin A Turlach
>>>>> on Sun, 19 Jun 2022 02:30:03 +0800 writes:
> G'day all, On Sat, 18 Jun 2022 22:58:19 +0800 Berwin A
> Turlach <Berwin.Turlach using gmail.com> wrote:
>> [...] I attach the relevant file from trying to compile
>> R-patched during last night's run.
> Mmh, on the web-interface to the mailing list I see that
> the attachment might have been deleted. Perhaps because
> it was too large?
> So below the start and the final part from
> reg-tests-1d.Rout.fail which shows where the error occurs.
> Cheers,
> Berwin
Aaah... now we are talking ;-)
Thank you, Berwin!
Your subject was misleading to me. This does not seem to be
about *compiling* R 4.2.x but rather *checking* / *testing* its
functionality *after compilation and installation.
I think you are right, and we should adapt our regression tests
to still not fail here.
Also, as I was the one who added these checks, I'd like to get
this "right".
Last but not least: We are *grateful* indeed for people like
you, testing a *pre-release* version such as '4.2.1 RC' as we
can see below.
Note that I do test with '../R/configure --disable-long-double'
but this cannot be the only reason.
BTW, all the pretty *warnings* below are fine and expected; the
problem is that resulting numbers end up "wrong"
I will need some more information:
Ideally, the R console output of these 5 lines of R code:
sessionInfo()
Sys.info()
capabilities()
str(.Machine)
str(.Platform)
Could you help here, doing this *off*-list?
Thanking you in advance and giving best regards,
Martin
> ----------------------------
> R version 4.2.1 RC (2022-06-17 r82501) -- "Funny-Looking Kid"
> Copyright (C) 2022 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu/32 (32-bit)
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>> ## Regression tests for R >= 3.4.0
> [...very large snip...]
>> ## pretty(x) when range(x) is finite but diff(range(x)) is +/- Inf:
>> B <- 1e308; 2*B; (s <- seq(-B,B,length.out = 3))
> [1] Inf
> [1] -1e+308 0e+00 1e+308
>> options(warn=1) # => warnings *as they happen*
>> (ps <- pretty(c(-B,B)))
> [1] -1e+308 -5e+307 0e+00 5e+307 1e+308
>> ## Warning in pretty.default(c(-B, B)) :
>> ## Internal(pretty()): very large range 4e+307, corrected to 2.24712e+307
>> nps <- length(ps)
>> dd <- sum((dps <- diff(ps))/length(dps)) # mean w/o overflow
>> epsC <- .Machine$double.eps
>> relD <- (dps/dd - 1)/epsC
>> relEr <- function(f, y) abs((f-y)/(f+y)*2) # cheap relative error, |f| > 0 !
>> stopifnot(is.finite(mean(ps)), ## these all failed without "long-double"
> + is.finite(mdp <- mean(dps)),
> + all.equal(dd, mdp, tolerance=1e-15))
>> stopifnot(relEr(c(-B,B), ps[c(1L,nps)]) <= 4*epsC,
> + -8 <= relD, relD <= 8) # seen [-1.5,.., 3.0]; w/o long-double: [-5, .., 4]
>> ## ps was 0 Inf Inf Inf Inf Inf Inf Inf Inf Inf 0 , in R <= 4.1.0
>> f. <- c(-1.797, -1.79, -1.75, seq(-1.7, -1, by=.1))
>> stopifnot(!is.unsorted(f.)) ; f.nm <- setNames(, f.)
>> fmtRng <- function(x) paste(format(range(x)), collapse=", ")
>> ns <- c(2:12, 15, 20, 30, 51, 100, 2001, 1e5)
>> nms.n <- formatC(ns, digits=0, format="f")
>> nmsRng <- c(t(outer(paste0("r",1:2), c("lo","hi"), paste, sep=".")))
>> rr <- matrix(NA, length(ns), 4, dimnames=list(nms.n, nmsRng))
>> for(i.n in seq_along(ns)) {
> + n <- ns[i.n]
> + cat("n = ", n,":\n--------\n")
> + pBL <- lapply(f., function(f) structure(pretty(c(f*1e308, 2^1023.9), n), f=f))
> + ## -> a warning per f
> + n.s <- lengths(pBL) # how close to target 'n' ??
> + cat("lengths(.) in [", fmtRng(n.s), "]\n")
> + if(n <= 15) stopifnot(n.s <= 20)# seen {14,..,17}
> + else stopifnot(abs(n.s/n - 1) <= 1/2)
> + if(n) cat("length(.) <> n relative err in [", fmtRng(n.s/n - 1), "]\n")
> + ## .pretty(*, bounds=FALSE) :
> + prM <- t(sapply(f.nm, function(f)
> + unlist( .pretty(c(f*1e308, 2^1023.9), n, bounds=FALSE) )))
> + print(prM)
> + luM <- prM[,c("ns","nu")] * prM[,"unit"] # the pretty-scaled unit
> + r1 <- luM[,"ns"] / (f.nm*1e308)
> + rr[i.n, 1:2] <- r1 <- range(r1)
> + cat(sprintf("range(r1): [%g, %g]\n", r1[1], r1[2]))
> + r2 <- luM[,"nu"] / 2^1023.9
> + rr[i.n, 3:4] <- r2 <- range(r2)
> + cat(sprintf("range(r2): [%g, %g]\n", r2[1], r2[2]))
> + stopifnot(exprs = { is.matrix(prM)
> + prM[,"nu"] - prM[,"ns"] == prM[,"n"] # could differ, but not for this data
> + identical(colnames(prM), c("ns", "nu", "n", "unit"))
> + ## These bounds depend on 'n' :
> + r1 >= if(n <= 12) 0.55 else 0.89
> + r1 <= if(n <= 15) 1.4 else 1.1
> + r2 >= if(n <= 12) 0.58 else 0.95
> + r2 <= if(n <= 15) 1 else 1.025
> + })
> + invisible(lapply(pBL, function(ps) {
> + mdB <- sum((dB <- diff(ps))/length(dB))
> + rd <- dB/mdB - 1 # relative differences
> + ## print(range(rd))
> + x <- c(attr(ps,"f")*1e308, 2^1023.9)
> + stopifnot(if(n >= 1) abs(rd) <= n * 3e-15 else TRUE,
> + ps[1] <= x[1] , x[2] <= ps[length(ps)])
> + }))
> + }
> n = 2 :
> --------
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.73715e+308, corrected to 1.43815e+308
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.73365e+308, corrected to 1.43815e+308
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.71365e+308, corrected to 1.43815e+308
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.68865e+308, corrected to 1.43815e+308
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.63865e+308, corrected to 1.43815e+308
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.58865e+308, corrected to 1.43815e+308
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.53865e+308, corrected to 1.43815e+308
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.48865e+308, corrected to 1.43815e+308
> Warning in pretty.default(c(f * 1e+308, 2^1023.9), n) :
> R_pretty(): very large range 'cell'=1.43865e+308, corrected to 1.43815e+308
> lengths(.) in [ 1, 3 ]
> length(.) <> n relative err in [ -0.5, 0.5 ]
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.73715e+308, corrected to 1.43815e+308
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.73365e+308, corrected to 1.43815e+308
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.71365e+308, corrected to 1.43815e+308
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.68865e+308, corrected to 1.43815e+308
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.63865e+308, corrected to 1.43815e+308
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.58865e+308, corrected to 1.43815e+308
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.53865e+308, corrected to 1.43815e+308
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.48865e+308, corrected to 1.43815e+308
> Warning in .pretty(c(f * 1e+308, 2^1023.9), n, bounds = FALSE) :
> R_pretty(): very large range 'cell'=1.43865e+308, corrected to 1.43815e+308
> ns nu n unit
> -1.797 0 0 0 Inf
> -1.79 0 0 0 Inf
> -1.75 0 0 0 Inf
> -1.7 0 0 0 Inf
> -1.6 0 0 0 Inf
> -1.5 0 0 0 Inf
> -1.4 0 0 0 Inf
> -1.3 0 0 0 Inf
> -1.2 0 0 0 Inf
> -1.1 -1 1 2 1e+308
> -1 -1 1 2 1e+308
> range(r1): [NaN, NaN]
> range(r2): [NaN, NaN]
> Error: r1 >= if (n <= 12) 0.55 else 0.89 are not all TRUE
> Execution halted
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
More information about the R-devel
mailing list