Hi everyone 
I'm trying to install sf 0.9-0 on my Mac (running macOS Catalina 10.15.4) and I haven't been able to due to a configuration error. Seems like I'm missing a file (?) called libproj...
After running `install.package("sf") I get a prompt asking if I want to install the package from source, I said yes and I got the following output:
installing the source package ‘sf’
trying URL 'https://cran.rstudio.com/src/contrib/sf_0.9-0.tar.gz'
Content type 'application/x-gzip' length 8474738 bytes (8.1 MB)
==================================================
downloaded 8.1 MB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.4
checking GDAL version >= 2.0.1... yes
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/local/Cellar/gdal/2.4.4_2/share/gdal/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 2.4.4
checking proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj not found in standard or given locations.
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sf’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sf’
I also tried installing it using devtools::install_github("r-spatial/sf") without success. I think the outputs are the same but here it is in case I overlooked something:
Downloading GitHub repo r-spatial/sf@master
✓ checking for file ‘/private/var/folders/qp/11_9l8590y79g2ck741t5dx00000gq/T/RtmpfhBVcC/remotes15c2199afdc7/r-spatial-sf-8cc2adf/DESCRIPTION’ (367ms)
─ preparing ‘sf’:
✓ checking DESCRIPTION meta-information ...
─ cleaning src
─ running ‘cleanup’
─ checking for LF line-endings in source and make files and shell scripts (498ms)
─ checking for empty or unneeded directories
─ building ‘sf_0.9-1.tar.gz’
* installing *source* package ‘sf’ ...
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.4
checking GDAL version >= 2.0.1... yes
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/local/Cellar/gdal/2.4.4_2/share/gdal/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 2.4.4
checking proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj not found in standard or given locations.
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sf’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sf’
Error: Failed to install 'sf' from GitHub:
(converted from warning) installation of package ‘/var/folders/qp/11_9l8590y79g2ck741t5dx00000gq/T//RtmpfhBVcC/file15c2502038fa/sf_0.9-1.tar.gz’ had non-zero exit status
This happens even after following the instructions from sf's GitHub repo (e.g., install pkg-config and gdal through homebrew), which should make it possible to install sf from source so I have no idea where I went wrong...
Does anybody know how to solve this?
Here's my session info:
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.4
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4 rstudioapi_0.11 magrittr_1.5 usethis_1.5.1
[5] devtools_2.2.2 pkgload_1.0.2 R6_2.4.1 rlang_0.4.5
[9] fansi_0.4.1 tools_3.6.3 pkgbuild_1.0.6 sessioninfo_1.1.1
[13] cli_2.0.2 withr_2.1.2 ellipsis_0.3.0 remotes_2.1.1
[17] assertthat_0.2.1 digest_0.6.25 rprojroot_1.3-2 crayon_1.3.4
[21] processx_3.4.2 callr_3.4.3 fs_1.3.2 ps_1.3.2
[25] curl_4.3 testthat_2.3.2 memoise_1.1.0 glue_1.3.2
[29] compiler_3.6.3 desc_1.2.0 backports_1.1.5 prettyunits_1.1.1
Cheers and thanks in advance!