[R-pkg-devel] CRAN Debian error installation time

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Tue Jan 28 17:03:09 CET 2025


Thank you for actually posting a reference to your package and its source
code. That allows us to take a closer look.

On 28 January 2025 at 16:07, Guillermo Vinue wrote:
| Thank you for your help, Ben and Ivan. Unfortunately, the note persists:
| https://win-builder.r-project.org/incoming_pretest/fawir_1.0_20250128_113725/Debian/00check.log

There is one NOTE here stating that _installation_ takes more compute than
elapsed time.  I have no idea why as I canot reproduce this:
  - with r-release I get
    * checking whether package ‘fawir’ can be installed ... [11s/7s] OK
  - with r-devel I get
    * checking whether package ‘fawir’ can be installed ... [16s/13s] OK
Neither one signals an issue. 

| The public source repository from my package is here:
| https://github.com/guivivi/fawir
| The function that seems to cause the problem is
| https://github.com/guivivi/fawir/blob/master/R/do_player_recruitment.R
| because it uses RcppParallel::setThreadOptions
| 
| Until now, my package includes:
| - a configure file with this content:
| #!/bin/sh
| # Globally restrict threads
| export OMP_NUM_THREADS=1
| export MKL_NUM_THREADS=1
| export OPENBLAS_NUM_THREADS=1
| export R_INSTALL_NCPUS=1
| 
| # Pass make flags
| export MAKEFLAGS="-j1"
| 
| # Proceed with configuration
| exit 0

This is likely irrelevant. You package has no source code to compile.
 
| - an .Rprofile file with this content:
| Sys.setenv(R_INSTALL_NCPUS = 1)

I do not think your source package has this and so it will not affect the
CRAN machine.
 
| - a zzz.R file with this content:
| .onLoad <- function(libname, pkgname) {
|   # Restrict threading globally
|   Sys.setenv(OMP_NUM_THREADS = 1)
|   Sys.setenv(MKL_NUM_THREADS = 1)
|   Sys.setenv(OPENBLAS_NUM_THREADS = 1)
|   Sys.setenv(R_INSTALL_NCPUS = 1)

That won't work. Environment variables have be set before the process
starts. You cannot influence the running R process.
 
|   # Set RcppParallel to single-threaded
|   RcppParallel::setThreadOptions(numThreads = 1)
| }
| 
| - a vignette with these headers:
|  %\VignetteDepends{RcppParallel}
|  %\VignetteKeyword{no_install}
| 
| - the option \dontrun{} in the examples of the function that uses
| setThreadOptions
| 
| - this command inside do_player_recruitment:
| if (!identical(Sys.getenv("NOT_CRAN"), "true")) {
|     invisible(capture.output({word_vectors <-
| glove_model$fit_transform(tcm, n_threads = 1)}))
|   }
| 
| But the note from CRAN persists.
| 
| Can anyone provide me with any insight? Many thanks in any case.

One idea may be to consider avoiding the downloading and aggregating of data
on each build.  You could provide a small data sample in the package so user
have something to work with, provide the functions to get more but do not
force them to run on package build?

Dirk

| 
| Kind regards,
| 
| Guillermo
| 
| El lun, 27 ene 2025 a las 21:36, Ivan Krylov (<ikrylov using disroot.org>)
| escribió:
| 
| > Dear Guillermo,
| >
| > Welcome to R-package-devel!
| >
| > В Mon, 27 Jan 2025 19:26:10 +0100
| > Guillermo Vinue <guillermovinue using gmail.com> пишет:
| >
| > > I am writing to you because I am getting this NOTE from the CRAN
| > > Debian machine that is not allowing CRAN acceptance: "Installation
| > > took CPU time 2.9 times elapsed time". Uwe Ligges told me that this
| > > means that I am using more than 2 cores, but I must not use more than
| > > 2 by default.
| >
| > The key word here is "installation". Check your configure/build
| > scripts. Are you using CMake, Ninja, or Cargo? Does it default to using
| > as many parallel processes as feasible? Most build systems nowadays
| > accept the -j flag to control that. Make sure to give it the flag that
| > limits it to two processes (most likely -j 2) when running on CRAN:
| >
| > http://contributor.r-project.org/cran-cookbook/code_issues.html#using-more-than-2-cores
| >
| > The above advice is very general and may completely miss the mark. If
| > you provide the links to the latest CRAN pre-test logs and the package
| > source code, someone will be able to give more precise advice.
| >
| > --
| > Best regards,
| > Ivan
| >
| 
| 	[[alternative HTML version deleted]]
| 
| ______________________________________________
| R-package-devel using r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list