summarylogtreecommitdiffstats
path: root/cran_multithread.patch
diff options
context:
space:
mode:
authorbartus2021-01-22 13:21:37 +0100
committerbartus2021-01-23 10:58:16 +0100
commitb53541d810be319d427bb66c63dd55886473464e (patch)
tree50a8bdb22799c0f0ef666cff37fcca3cf173d823 /cran_multithread.patch
parent3d80bdea3612f33b5672e213d40d494f76358622 (diff)
downloadaur-b53541d810be319d427bb66c63dd55886473464e.tar.gz
Parallelize R.install.packages()
Diffstat (limited to 'cran_multithread.patch')
-rw-r--r--cran_multithread.patch13
1 files changed, 13 insertions, 0 deletions
diff --git a/cran_multithread.patch b/cran_multithread.patch
new file mode 100644
index 000000000000..57cacc88a746
--- /dev/null
+++ b/cran_multithread.patch
@@ -0,0 +1,13 @@
+diff --git a/dependencies/common/install-packages b/dependencies/common/install-packages
+index e0d184e5f0..658fd31fd4 100755
+--- a/dependencies/common/install-packages
++++ b/dependencies/common/install-packages
+@@ -104,7 +104,7 @@ fi
+
+ # install packages needed to run tests
+ for RPKG in rmarkdown renv testthat xml2 yaml; do
+- RINSTALLCMD="if("'!'"require($RPKG, quietly = TRUE)) { install.packages('$RPKG', lib='$RPKGLIB', repos='https://cran.rstudio.com/') }"
++ RINSTALLCMD="if("'!'"require($RPKG, quietly = TRUE)) { options(Ncpus = @@proc_num@@ ); install.packages('$RPKG', lib='$RPKGLIB', repos='https://cran.rstudio.com/') }"
+ echo "> $RINSTALLCMD"
+ Rscript -e "$RINSTALLCMD"
+ done