Error installing packages using renv::restore()
Asked Answered
S

1

6

I have a problem using . For a larger project we want to use to all have the same version of and all our packages. Yet, as soon as a newer version of a package is available and we run renv::restore() we get an error like the following (please note: is not the only package. It also happens with greybox, mime, stringi and many more).

Error installing package 'RcppArmadillo':
=========================================

* installing *source* package 'RcppArmadillo' ...
** Package 'RcppArmadillo' successfully unpacked and MD5 sums checked
** using staged installation

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************


** libs
Warning in system(paste(cmd, "shlib-clean")) 'make' not found
Warning in system(cmd) 'make' not found
ERROR: compilation failed for package 'RcppArmadillo'
* removing 'C:/Users/..../renv/staging/1/RcppArmadillo'
Error: install of package 'RcppArmadillo' failed

I now have two questions:

  1. How can I fix this error?
  2. How can we use the same versions of packages throughout our team if crashes everytime a newer version is available?

Thank you. Lizzie

Scarlett answered 20/3, 2020 at 17:42 Comment(0)
C
6

The ultimate issue here is that renv is trying to install these packages from sources, as binaries for these older packages are no longer available from CRAN. There are two potential solutions to this issue:

  1. Consider using a MRAN checkpoint as your R repository. The plus side is that binaries for these older packages will remain available; the downside is that you won't be informed if newer packages do become available.

  2. Install the requisite software so you can build these packages from sources.

For 2. on Windows, you will need to install Rtools:

https://cran.r-project.org/bin/windows/Rtools/

You can also use the renv::equip() function to download a variety of libraries needed to compile some packages from sources (for example, nloptr).

Chisholm answered 21/3, 2020 at 4:42 Comment(1)
Thank you for your answer. At least I now understand what the issue is. For some of our projects switching to MRAN is not possible, as the client insists on using CRAN. But for some projects we will try this option. Sidenote: I have Rtools installed already and my IT department does not allow me to install and use software to build these packages from their source.Scarlett

© 2022 - 2024 — McMap. All rights reserved.