Home > other >  Terra package update isssue
Terra package update isssue

Time:11-20

Updating Terra from 1.6-17 to 1.6-41 returns this error:

Warning messages:
1: In i.p(...) : installation of package ‘terra’ had non-zero exit status
2: In i.p(...) :
  installation of package ‘C:/Users/Ed/AppData/Local/Temp/RtmpKu3Fdh/file26f04b99747d/rayshader_0.30.2.tar.gz’ had non-zero exit status

I get this error while running:

devtools::install_github("tylermorganwall/rayshader")

And I also get the same error while individually updating terra in R.

How can I fix this?

Purpose: To install rayshader from GitHub.

Session info: (don't know why sessioninfo() is picking up Windows 11 as Windows 10, strange)

> sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default  

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

other attached packages:
 [1] magrittr_2.0.3     knitr_1.41         rgdal_1.6-2       
 [4] rgeos_0.5-9        sp_1.5-1           RColorBrewer_1.1-3
 [7] pxR_0.42.4         plyr_1.8.8         RJSONIO_1.3-1.6   
[10] reshape2_1.4.4     sf_1.0-9           forcats_0.5.2     
[13] stringr_1.4.1      dplyr_1.0.10       purrr_0.3.5       
[16] readr_2.1.3        tidyr_1.2.1        tibble_3.1.8      
[19] ggplot2_3.4.0      tidyverse_1.3.2   

loaded via a namespace (and not attached):
  [1] googledrive_2.0.0   colorspace_2.0-3    ellipsis_0.3.2     
  [4] class_7.3-20        rprojroot_2.0.3     base64enc_0.1-3    
  [7] fs_1.5.2            rstudioapi_0.14     proxy_0.4-27       
 [10] farver_2.1.1        remotes_2.4.2       fansi_1.0.3        
 [13] lubridate_1.9.0     xml2_1.3.3          codetools_0.2-18   
 [16] doParallel_1.0.17   cachem_1.0.6        pkgload_1.3.2      
 [19] jsonlite_1.8.3      broom_1.0.1         dbplyr_2.2.1       
 [22] png_0.1-7           shiny_1.7.3         compiler_4.2.1     
 [25] httr_1.4.4          backports_1.4.1     assertthat_0.2.1   
 [28] fastmap_1.1.0       gargle_1.2.1        cli_3.4.1          
 [31] later_1.3.0         htmltools_0.5.3     prettyunits_1.1.1  
 [34] tools_4.2.1         gtable_0.3.1        glue_1.6.2         
 [37] Rcpp_1.0.9          cellranger_1.1.0    vctrs_0.5.1        
 [40] iterators_1.0.14    xfun_0.35           ps_1.7.2           
 [43] rvest_1.0.3         timechange_0.1.1    mime_0.12          
 [46] miniUI_0.1.1.1      lifecycle_1.0.3     devtools_2.4.5     
 [49] googlesheets4_1.0.1 MASS_7.3-58.1       scales_1.2.1       
 [52] ragg_1.2.4          hms_1.1.2           promises_1.2.0.1   
 [55] parallel_4.2.1      curl_4.3.3          yaml_2.3.6         
 [58] memoise_2.0.1       stringi_1.7.8       foreach_1.5.2      
 [61] e1071_1.7-12        pkgbuild_1.3.1      rlang_1.0.6        
 [64] pkgconfig_2.0.3     systemfonts_1.0.4   rgl_0.110.2        
 [67] evaluate_0.18       lattice_0.20-45     htmlwidgets_1.5.4  
 [70] labeling_0.4.2      tidyselect_1.2.0    processx_3.8.0     
 [73] R6_2.5.1            profvis_0.3.7       generics_0.1.3     
 [76] DBI_1.1.3           pillar_1.8.1        haven_2.5.1        
 [79] withr_2.5.0         units_0.8-0         modelr_0.1.10      
 [82] crayon_1.5.2        KernSmooth_2.23-20  utf8_1.2.2         
 [85] urlchecker_1.0.1    tzdb_0.3.0          rmarkdown_2.18     
 [88] usethis_2.1.6       progress_1.2.2      grid_4.2.1         
 [91] readxl_1.4.1        isoband_0.2.6       callr_3.7.3        
 [94] reprex_2.0.2        digest_0.6.30       classInt_0.4-8     
 [97] xtable_1.8-4        httpuv_1.6.6        textshaping_0.3.6  
[100] munsell_0.5.0       viridisLite_0.4.1   sessioninfo_1.2.2

#Update

After starting RStudio and a clean environment, updating terra from CRAN still returns the exit status error.

Some more info:

C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lblosc
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lkea
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lsz
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'terra'

CodePudding user response:

See these instructions for installing "terra" from source-code. If you cannot wait for CRAN to compile or update, you can install the development version with

install.packages('terra', repos='https://rspatial.r-universe.dev')

Furthermore, if you are having trouble like this, start with a clean session, not one full with loaded packages.

  • Related