rubuntu-22.04

Compiling error for packages installation after updating to R 4.4 on Ubuntu 22.04


So I just updated to R 4.4. I'm on Ubuntu 22.04 for reference. Next step was to reinstall all my packages. The thing is, many of them get the same error. For instance, when trying to install "vroom"

install.packages("vroom")

I get very long text as usual when installing a package, but it ends with an error:

cc1plus: some warnings being treated as errors
make: *** [/usr/lib/R/etc/Makeconf:202 : delimited_index.o] Error 1
ERROR: compilation failed for package ‘vroom’
* removing ‘/home/username/R/x86_64-pc-linux-gnu-library/4.4/vroom’

So I've understood this is a compilation error with C++. I know nothing of C++.

I have found people with similar errors on the web that followed the pattern make: *** [text] Error 1 and people have suggested reinstalling the Rcpp package. I did it using the install.packages() function and had no issue with this installation. But my issue with installing other packages like vroom stays the same.

Do you have any idea how to solve this issue, or am I condemned to uninstall R and go back to 4.3 ?

Thanks for your time

Edit: Here is what the warnings look like.

/usr/lib/R/site-library/cpp11/include/cpp11/protect.hpp:337:42: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘SEXP’ {aka ‘SEXPREC*’} [-Wformat=]
  337 |       REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head));
      |                                         ~^                                 ~~~~~~~~~
      |                                          |                                    |
      |                                          unsigned int                         SEXP {aka SEXPREC*}

From the little I understand, they all look the same. The only thing that changes is the numbers after protect.hpp:. The warning occurs for arguments 2 to 5.


Solution

  • Same thing happened to me under Debian Bookworm. I was installing vroom to install tidyverse. This post here helped with the solution and so far it worked.

    Basically, remove all references to "-Werror=format-security" in /etc/R/Makeconf file (you'll need admin privileges). Save it and reinstall vroom / tidyverse.

    I cannot say, though, if this is a critical issue so after the install, I reinstated the Makeconf file as it was.