[Rd] install.packages("Bessel"): 'byte-compile and prepare package for lazy loading' step outputs numeric vectors?!?
Henrik Bengtsson
henr|k@bengt@@on @end|ng |rom gm@||@com
Thu Oct 15 21:24:44 CEST 2026
Thanks.
I was puzzled by the fact that the output managed to "penetrate" R CMD
INSTALL and the numeric sequence ressembled something that could be
produced during bytecode compilation.
Today I learned: You can output stdout, messages, and warnings during
R CMD INSTALL, e.g.
$ cat R/stray-output.R
cat("STDOUT: Output generated during package installation\n")
message("MESSAGE: Message generated during package installation")
warning("WARNING: Immediate warning generated during package
installation", immediate. = TRUE)
This will output:
$ R CMD INSTALL teeny_1.0.tar.gz
* installing to library
‘/home/hb/R/ubuntu24_04-x86_64-pc-linux-gnu-library/4.6-CBI-gcc13’
* installing *source* package ‘teeny’ ...
** this is package ‘teeny’ version ‘1.0’
** using staged installation
** R
** byte-compile and prepare package for lazy loading
STDOUT: Output generated during package installation
MESSAGE: Message generated during package installation
Warning in eval(exprs[i], envir) :
WARNING: Immediate warning generated during package installation
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (teeny)
Not sure if that's how R CMD INSTALL is meant to work, or it's by
design. FWIW, it does *not* come through during 'R CMD build' or 'R
CMD check'.
If not clear from Dirk's patch, this is what happens in the Bessel
source code; it seems that there's some stray, leftover assertion
code;
https://github.com/cran/Bessel/blob/1eddb99c93bcbe5abbfb15c42ea0869ae9fde998/R/lsum.R#L71-L85
/Henrik
On Wed, Oct 14, 2026 at 7:32 PM Dirk Eddelbuettel <edd using debian.org> wrote:
>
>
> On 14 October 2026 at 19:25, Henrik Bengtsson wrote:
> | What's up with:
> |
> | ** byte-compile and prepare package for lazy loading
> | [1] 0.5 1 -1 2 -5 14 -42 132
> | -429 1430 -4862 16796 -58786 208012 -742900
> | c(0, 1, -1, 2, -5, 14, -42, 132, -429, 1430, -4862, 16796, -58786,
> | 208012, -742900)
> |
> | in:
> |
> | > install.packages("Bessel", repos = "https://cloud.r-project.org")
> | Installing package into
> | '/home/hb/R/ubuntu24_04-x86_64-pc-linux-gnu-library/4.6-CBI-gcc13'
> | (as 'lib' is unspecified)
> | trying URL 'https://cloud.r-project.org/src/contrib/Bessel_0.7-1.tar.gz'
> | Content type 'application/x-gzip' length 193731 bytes (189 KB)
> | ==================================================
> | downloaded 189 KB
> |
> | * installing *source* package ‘Bessel’ ...
> | ** this is package ‘Bessel’ version ‘0.7-1’
> | ** package ‘Bessel’ successfully unpacked and MD5 sums checked
> | ** using staged installation
> | ** libs
> | using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
> | using Fortran compiler: ‘GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
> | gfortran -fpic -g -O2 -c IncompleteBessel.f -o IncompleteBessel.o
> | gcc -std=gnu2x -I"/home/hb/shared/software/CBI/_ubuntu24_04/R-4.6.1-gcc13/lib/R/include"
> | -DNDEBUG -I/usr/local/include -fpic -g -O2 -c init.c -o init.o
> | gcc -std=gnu2x -I"/home/hb/shared/software/CBI/_ubuntu24_04/R-4.6.1-gcc13/lib/R/include"
> | -DNDEBUG -I/usr/local/include -fpic -g -O2 -c zbsubs.c -o
> | zbsubs.o
> | gcc -std=gnu2x -shared
> | -L/home/hb/shared/software/CBI/_ubuntu24_04/R-4.6.1-gcc13/lib/R/lib
> | -L/usr/local/lib -o Bessel.so IncompleteBessel.o init.o zbsubs.o
> | -lgfortran -lm -lquadmath
> | -L/home/hb/shared/software/CBI/_ubuntu24_04/R-4.6.1-gcc13/lib/R/lib
> | -lR
> | installing to /home/hb/R/ubuntu24_04-x86_64-pc-linux-gnu-library/4.6-CBI-gcc13/00LOCK-Bessel/00new/Bessel/libs
> | ** R
> | ** inst
> | ** byte-compile and prepare package for lazy loading
> | [1] 0.5 1 -1 2 -5 14 -42 132
> | -429 1430 -4862 16796 -58786 208012 -742900
> | c(0, 1, -1, 2, -5, 14, -42, 132, -429, 1430, -4862, 16796, -58786,
> | 208012, -742900)
> | ** help
> | *** installing help indices
> | ** building package indices
> | ** installing vignettes
> | ** testing if installed package can be loaded from temporary location
> | ** checking absolute paths in shared objects and dynamic libraries
> | ** testing if installed package can be loaded from final location
> | ** testing if installed package keeps a record of temporary installation path
> | * DONE (Bessel)
> |
> | I get this with R 4.6.1 on Ubuntu 24.04 and on Rocky 9.
>
> Might be more a question for the maintainer (CC'ed) than for R-devel?
>
> This silences it, was easy enough to find just by looking for a print():
>
> edd using paul:/tmp/r$ diff -ru Bessel.orig/ Bessel
> diff -ru Bessel.orig/R/lsum.R Bessel/R/lsum.R
> --- Bessel.orig/R/lsum.R 2026-09-27 02:18:26.000000000 -0500
> +++ Bessel/R/lsum.R 2026-10-14 21:30:21.551083644 -0500
> @@ -73,10 +73,10 @@
> ## NB: Binomial series of (1+u)^(1/2), exact coefficients c_j / 2^(2j-1) :
> {
> k <- 0:14
> - print(quote=FALSE, width=130, # + rm space
> - chk <- formatC(ck <- choose(1/2, k) * 2^(2*k-1), width=1, format="fg"))
> + #print(quote=FALSE, width=130, # + rm space
> + chk <- formatC(ck <- choose(1/2, k) * 2^(2*k-1), width=1, format="fg")#)
> ## 0.5 1 -1 2 -5 14 -42 132 -429 1430 -4862 16796 -58786 208012 -742900
> - dput(round(ck)) # loses the 0.5
> + #dput(round(ck)) # loses the 0.5
> ## c(0, 1, -1, 2, -5, 14, -42, 132, -429, 1430, -4862, 16796, -58786, 208012, -742900)
> ## correct :
> ckT <- c(0.5, 1, -1, 2, -5, 14, -42, 132, -429, 1430, -4862, 16796, -58786, 208012, -742900)
> edd using paul:/tmp/r$
>
> Dirk
>
> |
> | /Henrik
> |
> | ______________________________________________
> | R-devel using r-project.org mailing list
> | https://stat.ethz.ch/mailman/listinfo/r-devel
>
> --
> dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
More information about the R-devel
mailing list