[R-pkg-devel] Disable parallelism on installation time

2024-07-17 Thread Alberson Miranda
Dear listeners,

I'm having a hard time trying to figure out the following NOTE:

|* checking whether package 'fio' can be installed... [202s/46s] NOTE 
Installation took CPU time 4.4 times elapsed time |

Uwe asked if there's code running in parallel by default and, yes, there 
was: my code uses rayon (general parallelism) and faer (linear algebra, 
with rayon feature on) Rust crates. So I did a little refactor and added 
a method to allow the user to specify max threads. Then I started every 
example, tests, vignette and readme by limiting threads to 1 to avoid 
parallelism.

Nonetheless, I still get the NOTE. Finally, out of despair, I've deleted 
vignettes, tests, code on readme and enclosed all examples 
with|\dontrun{}|but that didn't work either.

So my question is, besides examples, tests, vignettes and readme,*what 
parts of code runs during installation of a R package? Is parallelism 
the only trigger for that NOTE or could it be something else?*

Source code is here  and there's 
also a SO post with my failed attempts 

 
in detail.

-- 
Best,
Alberson Miranda

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Disable parallelism on installation time

2024-07-17 Thread Ivan Krylov via R-package-devel
В Tue, 16 Jul 2024 21:18:17 -0300
Alberson Miranda  пишет:

> besides examples, tests, vignettes and readme, what parts of code
> runs during installation of a R package

Neither. This is about `cargo build` compiling in parallel, not your
package code computing in parallel. Giving the -j 2 flag to cargo
should solve the problem:
https://github.com/R-ArcGIS/arcgisgeocode/blob/8fbd93c3607363a9fef2d445711de647e5127566/src/Makevars#L5

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Disable parallelism on installation time

2024-07-17 Thread Chung-hong Chan
To add to this, I would like to point out that extendr actually has a
guide on how to make an R package with Rust code CRAN compliance.

https://github.com/extendr/rextendr/blob/main/vignettes/articles/cran-compliance.Rmd


On Wed, Jul 17, 2024 at 10:21 AM Ivan Krylov via R-package-devel
 wrote:
>
> В Tue, 16 Jul 2024 21:18:17 -0300
> Alberson Miranda  пишет:
>
> > besides examples, tests, vignettes and readme, what parts of code
> > runs during installation of a R package
>
> Neither. This is about `cargo build` compiling in parallel, not your
> package code computing in parallel. Giving the -j 2 flag to cargo
> should solve the problem:
> https://github.com/R-ArcGIS/arcgisgeocode/blob/8fbd93c3607363a9fef2d445711de647e5127566/src/Makevars#L5
>
> --
> Best regards,
> Ivan
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel