To build sf from source you need the GDAL library. The easiest way to install GDAL, as well as GEOS and PROJ, on a mac is with the framework from Kyng Chaos which you can find here: http://www.kyngchaos.com/software/frameworks
They are also available on Homebrew; brew search for gdal, proj and geos. Assuming you install the frameworks from KyngChaos in the default locations, you can use the following R script to build sf from source: sf_config_args <- c( "--with-gdal-config=/Library/Frameworks/GDAL.Framework/Versions/2.1/unix/bin/gdal-config", "--with-geos-config=/Library/Frameworks/GEOS.Framework/Versions/3/unix/bin/geos-config", "--with-proj-include=/Library/Frameworks/PROJ.framework/Versions/4/unix/include", "--with-proj-lib=/Library/Frameworks/PROJ.framework/Versions/4/unix/lib", "--with-proj-share=/Library/Frameworks/PROJ.framework/Versions/4/unix/share/proj" ) install.packages("sf", configure.args = sf_config_args) Adjust the paths if you install GDAL, PROJ and GEOS to different locations. Lee On 1/11/18 12:26 PM, Manuel Spínola wrote: > Dear list members, > > When trying updating some packages in MacOS High Sierra 10.13 (R 3.4.2) > some packages, as "sf", fails: > >> install.packages("sf") > There is a binary version available but the source version is later: > binary source needs_compilation > sf 0.5-5 0.6-0 TRUE > > Do you want to install from sources the package which needs compilation? > y/n: y > > installing the source package ‘sf’ > > trying URL 'https://cran.rstudio.com/src/contrib/sf_0.6-0.tar.gz' > Content type 'application/x-gzip' length 7399611 bytes (7.1 MB) > ================================================== > downloaded 7.1 MB > > Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) : > unknown timezone 'default/America/Costa_Rica' > * installing *source* package ‘sf’ ... > ** package ‘sf’ successfully unpacked and MD5 sums checked > configure: CC: clang > configure: CXX: clang++ > checking for gdal-config... no > no > configure: error: gdal-config not found or not executable. > ERROR: configuration failed for package ‘sf’ > * removing > ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/sf’ > * restoring previous > ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/sf’ > Warning in install.packages : > installation of package ‘sf’ had non-zero exit status > > The downloaded source packages are in > ‘/private/var/folders/gf/vwlbzml90wv7cs2r4v00wg_m0000gn/T/RtmpbmvcCh/downloaded_packages’ > > Any solution to this problem? > > Manuel > [[alternative HTML version deleted]] _______________________________________________ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac