[R] How to add make option to package compilation?
lists at dewey.myzen.co.uk
Fri Sep 15 14:57:41 CEST 2017
On 15/09/2017 13:30, Martin Møller Skarbiniks Pedersen wrote:
> On 15 September 2017 at 14:13, Duncan Murdoch <murdoch.duncan at gmail.com>
>> On 15/09/2017 8:11 AM, Martin Møller Skarbiniks Pedersen wrote:
>>> I am installing a lot of packages to a new R installation and it takes
>>> long time.
>>> However the machine got 4 cpus and most of the packages are written in
>>> So is it possible to add a -j4 flag to the make command when I use the
>>> install.packages() function?
>>> That will probably speed up the package installation process 390%.
>> See the Ncpus argument in ?install.packages.
> However it looks like Ncpus=4 tries to compile four R packages at the same
> time using one cpu for each packages.
But you said you had lots to install so would that not speed things up too?
> From the documentation:
> Ncpus: the number of parallel processes to use for a parallel
> install of more than one source package. Values greater than
> one are supported if the ‘make’ command specified by
> ‘Sys.getenv("MAKE", "make")’ accepts argument ‘-k -j Ncpus’
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> This email has been checked for viruses by AVG.
More information about the R-help