leaflet
leaflet copied to clipboard
unable to install Leaflet due to "fatal error: png.h: No such file or directory"
i haven't used Leaflet in a while and i just tried install it again but ran into the following issue:
> install.packages("leaflet")
Installing package into ‘/home/christel/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘terra’, ‘png’, ‘raster’
trying URL 'https://cran.rstudio.com/src/contrib/terra_1.6-3.tar.gz'
Content type 'application/x-gzip' length 686866 bytes (670 KB)
==================================================
downloaded 670 KB
trying URL 'https://cran.rstudio.com/src/contrib/png_0.1-7.tar.gz'
Content type 'application/x-gzip' length 24990 bytes (24 KB)
==================================================
downloaded 24 KB
trying URL 'https://cran.rstudio.com/src/contrib/raster_3.5-21.tar.gz'
Content type 'application/x-gzip' length 577131 bytes (563 KB)
==================================================
downloaded 563 KB
trying URL 'https://cran.rstudio.com/src/contrib/leaflet_2.1.1.tar.gz'
Content type 'application/x-gzip' length 2010129 bytes (1.9 MB)
==================================================
downloaded 1.9 MB
* installing *source* package ‘terra’ ...
** package ‘terra’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘terra’
* removing ‘/home/christel_swift/R/x86_64-pc-linux-gnu-library/3.5/terra’
Warning in install.packages :
installation of package ‘terra’ had non-zero exit status
* installing *source* package ‘png’ ...
** package ‘png’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I"/opt/R/3.5.2/lib/R/include" -DNDEBUG -I/usr/local/include `libpng-config --cflags` -fpic -g -O2 -c read.c -o read.o
/bin/sh: libpng-config: command not found
read.c:3:17: fatal error: png.h: No such file or directory
#include <png.h>
^
compilation terminated.
make: *** [read.o] Error 1
ERROR: compilation failed for package ‘png’
* removing ‘/home/christel/R/x86_64-pc-linux-gnu-library/3.5/png’
Warning in install.packages :
installation of package ‘png’ had non-zero exit status
ERROR: dependency ‘terra’ is not available for package ‘raster’
* removing ‘/home/christel/R/x86_64-pc-linux-gnu-library/3.5/raster’
Warning in install.packages :
installation of package ‘raster’ had non-zero exit status
ERROR: dependencies ‘png’, ‘raster’ are not available for package ‘leaflet’
* removing ‘/home/christel/R/x86_64-pc-linux-gnu-library/3.5/leaflet’
Warning in install.packages :
installation of package ‘leaflet’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpF5F8B2/downloaded_packages’
Is this an issue with the terra dependency? or something else?
Here's my session info:
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.so
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8
[4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] remotes_2.4.1 data.table_1.14.2 shiny_1.7.2 RJDBC_0.2-8
[5] rJava_0.9-13 RPostgreSQL_0.6-2 httr_1.4.2 aws.s3_0.3.21
[9] aws.secrets_0.1.2 aws.ec2metadata_0.2.0 rjson_0.2.20 DBI_1.1.1
[13] fastglm_0.0.1 glue_1.5.0 sandwich_3.0-1 forcats_0.5.1
[17] stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4 readr_2.1.0
[21] tidyr_1.1.4 tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] jsonlite_1.7.2 modelr_0.1.8 assertthat_0.2.1 cellranger_1.1.0
[5] yaml_2.2.1 pillar_1.6.4 backports_1.4.0 lattice_0.20-45
[9] digest_0.6.28 promises_1.2.0.1 rvest_1.0.2 colorspace_2.0-2
[13] htmltools_0.5.2 httpuv_1.6.3 pkgconfig_2.0.3 broom_0.7.10
[17] haven_2.4.3 xtable_1.8-4 scales_1.1.1 processx_3.5.2
[21] later_1.3.0 tzdb_0.2.0 generics_0.1.1 ellipsis_0.3.2
[25] withr_2.4.2 cli_3.1.0 magrittr_2.0.1 crayon_1.4.2
[29] readxl_1.3.1 mime_0.12 ps_1.6.0 fs_1.5.0
[33] fansi_0.5.0 xml2_1.3.2 pkgbuild_1.2.0 prettyunits_1.1.1
[37] tools_3.5.0 hms_1.1.1 lifecycle_1.0.1 munsell_0.5.0
[41] reprex_2.0.1 callr_3.7.0 compiler_3.5.0 rlang_0.4.12
[45] grid_3.5.0 rstudioapi_0.13 aws.signature_0.6.0 base64enc_0.1-3
[49] gtable_0.3.0 curl_4.3.2 R6_2.5.1 zoo_1.8-9
[53] lubridate_1.8.0 fastmap_1.1.0 utf8_1.2.2 stringi_1.7.5
[57] Rcpp_1.0.7 vctrs_0.3.8 dbplyr_2.1.1 tidyselect_1.1.1