appelmar / gdalcubes

Creating and analyzing Earth observation data cubes in R
https://gdalcubes.github.io
Other
120 stars 28 forks source link

Tries to load libpq.5.dylib under BigSur #40

Closed bjoernbos closed 3 years ago

bjoernbos commented 3 years ago

After upgrading to BigSur, I am getting an error message when loading gdalcubes:

> library(gdalcubes)
Fehler: package or namespace load failed for ‘gdalcubes’ in dyn.load(file, DLLpath = DLLpath, ...):
 kann shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/gdalcubes/libs/gdalcubes.so' nicht laden:
  dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/gdalcubes/libs/gdalcubes.so, 6): Library not loaded: /usr/lib/libpq.5.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/gdalcubes/libs/gdalcubes.so
  Reason: image not found

Apparently, it cannot load libpq.5.dylib, although the installation of gdalcubes works fine.

I've seen similar issues with sf (e.g., https://github.com/r-spatial/sf/issues/1536), pointing towards some changes in BigSur. Does gdalcubes needs to be adjusted as well?

> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

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

other attached packages:
 [1] rnaturalearth_0.1.0 raster_3.4-5        tmap_3.3            sp_1.4-5           
 [5] sf_0.9-7            viridis_0.5.1       viridisLite_0.3.0   magrittr_2.0.1     
 [9] here_1.0.1          forcats_0.5.1       stringr_1.4.0       dplyr_1.0.4        
[13] purrr_0.3.4         readr_1.4.0         tidyr_1.1.2         tibble_3.1.0       
[17] ggplot2_3.3.3       tidyverse_1.3.0    

loaded via a namespace (and not attached):
 [1] httr_1.4.2         jsonlite_1.7.2     modelr_0.1.8       assertthat_0.2.1   cellranger_1.1.0  
 [6] yaml_2.2.1         pillar_1.5.0       backports_1.2.1    lattice_0.20-41    glue_1.4.2        
[11] digest_0.6.27      RColorBrewer_1.1-2 rvest_0.3.6        colorspace_2.0-0   htmltools_0.5.1.1 
[16] XML_3.99-0.5       pkgconfig_2.0.3    broom_0.7.5        haven_2.3.1        stars_0.5-1       
[21] scales_1.1.1       generics_0.1.0     ellipsis_0.3.1     withr_2.4.1        leafsync_0.1.0    
[26] cli_2.3.1          crayon_1.4.1       readxl_1.3.1       ncdf4_1.17         fs_1.5.0          
[31] fansi_0.4.2        xml2_1.3.2         lwgeom_0.2-5       class_7.3-18       RcppProgress_0.4.2
[36] tools_4.0.4        hms_1.0.0          lifecycle_1.0.0    munsell_0.5.0      reprex_1.0.0      
[41] compiler_4.0.4     e1071_1.7-4        rlang_0.4.10       classInt_0.4-3     units_0.7-0       
[46] grid_4.0.4         tmaptools_3.1-1    dichromat_2.0-0    rstudioapi_0.13    htmlwidgets_1.5.3 
[51] crosstalk_1.1.1    base64enc_0.1-3    leafem_0.1.3       codetools_0.2-18   gtable_0.3.0      
[56] abind_1.4-5        DBI_1.1.1          R6_2.5.0           gridExtra_2.3      lubridate_1.7.10  
[61] knitr_1.31         utf8_1.1.4         rprojroot_2.0.2    KernSmooth_2.23-18 stringi_1.5.3     
[66] parallel_4.0.4     Rcpp_1.0.6         png_0.1-7          vctrs_0.3.6        leaflet_2.0.4.1   
[71] dbplyr_2.1.0       tidyselect_1.1.0   xfun_0.21   
appelmar commented 3 years ago

Thanks for reporting. I think this is exactly the same issue as with sf that was fixed in https://github.com/R-macos/recipes/issues/14. Have you tried to reinstall gdalcubes from CRAN?

bjoernbos commented 3 years ago

Thanks for your suggestion. I needed to reinstall Xcode Command-line Tools (xcode-select --install) and then install gdalcubes from source again (install.packages("gdalcubes", type = "source")). Now it works.

ktoddbrown commented 3 years ago

For what it's worth, I got the same error and it was resolved by.

brew install libgit2 brew install udunits