Failed installation of stars package - pkg-config and gdal-config not found

Hi all,

I'm trying to install the stars package on my Mac (M1, running Big Sur version 11.6.5). I'm getting the error message pasted below. Would you have any advice what to do about this?

installing the source packages ‘sf’, ‘lwgeom’, ‘stars’

trying URL 'https://cran.rstudio.com/src/contrib/sf_1.0-8.tar.gz'
Content type 'application/x-gzip' length 3472914 bytes (3.3 MB)
==================================================
downloaded 3.3 MB

trying URL 'https://cran.rstudio.com/src/contrib/lwgeom_0.2-9.tar.gz'
Content type 'application/x-gzip' length 473782 bytes (462 KB)
==================================================
downloaded 462 KB

trying URL 'https://cran.rstudio.com/src/contrib/stars_0.5-6.tar.gz'
Content type 'application/x-gzip' length 2983326 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang -mmacosx-version-min=10.13
configure: CXX: clang++ -mmacosx-version-min=10.13 -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing ‘/Users/laszloda/Library/R/4.0/library/sf’
* restoring previous ‘/Users/laszloda/Library/R/4.0/library/sf’
Warning in install.packages :
  installation of package ‘sf’ had non-zero exit status
* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang -mmacosx-version-min=10.13
configure: CXX: clang++ -mmacosx-version-min=10.13 -std=gnu++11
./configure: line 2264: pkg-config: command not found
checking for gcc... clang -mmacosx-version-min=10.13
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 the compiler supports GNU C... yes
checking whether clang -mmacosx-version-min=10.13 accepts -g... yes
checking for clang -mmacosx-version-min=10.13 option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for proj.h... no
checking for pj_init_plus in -lproj... no
configure: error: libproj not found in standard or given locations.
ERROR: configuration failed for package ‘lwgeom’
* removing ‘/Users/laszloda/Library/R/4.0/library/lwgeom’
Warning in install.packages :
  installation of package ‘lwgeom’ had non-zero exit status
ERROR: dependency ‘lwgeom’ is not available for package ‘stars’
* removing ‘/Users/laszloda/Library/R/4.0/library/stars’
Warning in install.packages :
  installation of package ‘stars’ had non-zero exit status

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.