Hi folks,

I'm working on re-submitting {greta} onto CRAN after it was archived last
year. I keep running into this NOTE:

```
Flavor: r-devel-linux-x86_64-debian-gcc
Check: re-building of vignette outputs, Result: NOTE
  Re-building vignettes had CPU time 4.1 times elapsed time
```

Searching this email list, I understand this error means that our code is
using 2 or more cores. I am a bit confused how this is happening on CRAN,
as we mostly skip running of vignettes on CRAN as it involves installing
tensorflow and tensorflow probability. I have tried very hard to limit the
vignettes to only use 2 cores, by setting options like the following in the
vignette:

```{r setup, include = FALSE}

knitr::opts_chunk$set(echo = TRUE,
                      eval = greta:::check_tf_version("message"),
                      purl = greta:::check_tf_version("message"),
                      cache = TRUE,
                      comment = NA,
                      progress = FALSE)

# Force limit to 2 cores for CRAN
Sys.setenv("R_PARALLELLY_AVAILABLE_CORES" = "2")
Sys.setenv("MC_CORES" = "2")
Sys.setenv("OMP_THREAD_LIMIT" = "2")
Sys.setenv("OMP_NUM_THREADS" = "2")
options(mc.cores = 2)

# ...
```

This above approach does not seem to solve this problem. Searching more
generally, I see
https://contributor.r-project.org/cran-cookbook/code_issues.html#using-more-than-2-cores
and

I also note that I cannot reproduce the same error with:

```
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran",
"--no-multiarch"), env =
"_R_CHECK_VIGNETTE_TIMING_CPU_TO_ELAPSED_THRESHOLD_ = 53")
```

I'm wondering if there is something I am missing on how to deal with this
vignette building NOTE, or if I should if ask CRAN can ignore this NOTE?

Best,

Nick

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to