14

In trying to install the package tidyverse, I get errors in the installation of dependency tidyr.

Here is the tail of the message I get:

cpp11.cpp:31:100: error: ‘unmove’ is not a member of ‘cpp11’
     return cpp11::as_sexp(simplifyPieces(cpp11::unmove(cpp11::as_cpp<cpp11::list>(pieces)), cpp11::unmove(cpp11::as_cpp<int>(p)), cpp11::unmove(cpp11::as_cpp<bool>(fillLeft))));
                                                                                                    ^~~~~~
cpp11.cpp:31:138: error: ‘unmove’ is not a member of ‘cpp11’
     return cpp11::as_sexp(simplifyPieces(cpp11::unmove(cpp11::as_cpp<cpp11::list>(pieces)), cpp11::unmove(cpp11::as_cpp<int>(p)), cpp11::unmove(cpp11::as_cpp<bool>(fillLeft))));
                                                                                                                                          ^~~~~~
/usr/lib/R/etc/Makeconf:176: recipe for target 'cpp11.o' failed
make: *** [cpp11.o] Error 1
ERROR: compilation failed for package ‘tidyr’
* removing ‘/home/xxx/yyy/tidyr’
Warning in install.packages :
  installation of package ‘tidyr’ had non-zero exit status

To my naive eye, it would seem the issue lies with cpp11. I saw a similar question regarding tidyr installation error due to cpp11 compilation error (R tidyr package installation failed due to cpp11 compilation error (expansion pattern x contains no argument packs)), but it was for a RHEL system.

I have the latest version of gcc/c++ installed on my system (4:7.4.0-1ubuntu2.3). The latest version of system dependencies libcurl4-openssl-dev libssl-dev libxml2-dev are also installed.

Here is the output of sessionInfo():

R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8     LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] rstudioapi_0.11   magrittr_1.5      usethis_1.6.1     devtools_2.3.1    pkgload_1.1.0     R6_2.4.1          rlang_0.4.7       fansi_0.4.1       tools_4.0.2      
[10] pkgbuild_1.1.0    sessioninfo_1.1.1 cli_2.0.2         withr_2.2.0       ellipsis_0.3.1    remotes_2.2.0     assertthat_0.2.1  digest_0.6.25     rprojroot_1.3-2  
[19] crayon_1.3.4      processx_3.4.3    callr_3.4.3       fs_1.5.0          ps_1.3.3          curl_4.3          testthat_2.3.2    memoise_1.1.0     glue_1.4.1       
[28] compiler_4.0.2    desc_1.2.0        backports_1.1.8   prettyunits_1.1.1
msoftrain
  • 1,017
  • 8
  • 23
  • Very similar problem here. Started pretty recently for us ( in the last few days ) on a Docker machine. I don't have a lot of details, but wanted to mention that you are not the only one! – djacobs7 Aug 10 '20 at 22:36

4 Answers4

6

It looks like @hadley released an update to tidyr a few days ago, based on the new cpp11 package: https://github.com/tidyverse/tidyr/releases.

For some reason, this caused tidyr to not build for us.

Our (hopefully temporary!) workaround was like this:

(1) Remove dependency on tidyverse. Instead, explicitly depend on the subpackages( like dplyr/ggplot2/etc. )

(2) Install tidyr in the following way:

packageurl <- "https://cran.r-project.org/src/contrib/Archive/tidyr/tidyr_1.1.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
djacobs7
  • 11,357
  • 3
  • 25
  • 33
  • thank you very much it worked i was facing this error for a while 'ake: *** [cpp11.o] Error 1 ERROR: compilation failed for package ‘tidyr’ ─ removing ‘/tmp/RtmpIZOo8g/Rinstcc91657d2f02/tidyr’ ' – kcm Aug 11 '20 at 06:25
2

Looks like the following commit is addressing this, though not sure when it will be pushed to CRAN: https://github.com/r-lib/cpp11/commit/779669a4d0b07e9f9d9382114f44e4f6ff68eebb

mkamenet3
  • 90
  • 5
  • In case anyone has a dependency on `tidyr` in their R package on GitHub, I found that adding `Remotes: github::r-lib/cpp11` to my package `DESCRIPTION` file allowed TRAVIS-CI to build successfully. – mkamenet3 Aug 11 '20 at 19:26
1

I found the following here: https://github.com/tidyverse/tidyr/issues/1024

The workaround consists in downgrading cpp11 to version 0.1:

devtools::install_version("cpp11", version = "0.1", repos = "http://cran.us.r-project.org")
0

Based on the answers from @djacobs7, @mkamenet3, and @Leandro R. M. de Marco, I ended up implementing the following solution, which worked for me.

  1. Removing the cpp11 package, which I had installed from cran.
  2. Re-installing the cpp11 package, but this time from github, as it contains the commit mentioned by @mkamenet3.
devtools::install_github("r-lib/cpp11")
  1. Installing tidyr normally
install.packages("tidyr")
msoftrain
  • 1,017
  • 8
  • 23