rgdal with R > 3.5.x and GDAL > 2.3.x on macOS
Hi, desperately trying to get rgdal installed on R > 3.5.x with GDAL 2.3.0 on macOS High Sierra. I am aware of the discussion that a suitable compiler is needed since GDAL > 2.3.0. I've set CC=clang CXX=clang++ PKG_CXXFLAGS= -stdlib=libc++ -std=c++11 In ~/.R/Makevars as suggested here https://github.com/r-spatial/sf/issues/726 The automated checking during the rgdal installation shows that C++11 support is available. But still it complains about a lacking C++11 support. I've searched the web but could not find anything helpful. If I've overlooked something, please just point me to the link. Everything installed via homebrew (bottles) R 3.5.1 proj 5.1.0 (osgeo4mac) gdal 2.3.1 (homebrew core) macOS 10.13.1 (High Sierra)
install.packages("rgdal")
Installing package into ?/usr/local/lib/R/3.5/site-library? (as ?lib? is unspecified) trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.3-4.tar.gz' Content type 'application/x-gzip' length 1664774 bytes (1.6 MB) ================================================== downloaded 1.6 MB * installing *source* package ?rgdal? ... ** package ?rgdal? successfully unpacked and MD5 sums checked configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R configure: CC: clang configure: CXX: clang++ configure: C++11 support available configure: rgdal: 1.3-4 checking for /usr/bin/svnversion... yes configure: svn revision: 766 checking for gdal-config... /usr/local/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 2.3.1 checking C++11 support for GDAL >= 2.3.0... yes checking GDAL version >= 1.11.4... yes checking gdal: linking with --libs only... no checking gdal: linking with --libs and --dep-libs... no In file included from gdal_test.cc:1: In file included from /usr/local/Cellar/gdal2/2.3.1/include/gdal.h:45: /usr/local/Cellar/gdal2/2.3.1/include/cpl_port.h:187:6: error: Must have C++11 or newer. # error Must have C++11 or newer. ^ 1 error generated. In file included from gdal_test.cc:1: In file included from /usr/local/Cellar/gdal2/2.3.1/include/gdal.h:45: /usr/local/Cellar/gdal2/2.3.1/include/cpl_port.h:187:6: error: Must have C++11 or newer. # error Must have C++11 or newer. ^ 1 error generated. configure: Install failure: compilation and/or linkage problems. configure: error: GDALAllRegister not found in libgdal. ERROR: configuration failed for package ?rgdal? * removing ?/usr/local/lib/R/3.5/site-library/rgdal? Warning in install.packages : installation of package ?rgdal? had non-zero exit status The downloaded source packages are in ?/private/var/folders/nv/k87rzvfs55l6j6xt_0jwb4wm0000gn/T/Rtmp68hYW1/downloaded_packages?
install.packages("rgdal")
Installing package into ?/usr/local/lib/R/3.5/site-library? (as ?lib? is unspecified) trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.3-4.tar.gz' Content type 'application/x-gzip' length 1664774 bytes (1.6 MB) ================================================== downloaded 1.6 MB * installing *source* package ?rgdal? ... ** package ?rgdal? successfully unpacked and MD5 sums checked configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R configure: CC: clang configure: CXX: clang++ configure: C++11 support available configure: rgdal: 1.3-4 checking for /usr/bin/svnversion... yes configure: svn revision: 766 checking for gdal-config... /usr/local/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 2.3.1 checking C++11 support for GDAL >= 2.3.0... yes checking GDAL version >= 1.11.4... yes checking gdal: linking with --libs only... no checking gdal: linking with --libs and --dep-libs... no In file included from gdal_test.cc:1: In file included from /usr/local/Cellar/gdal/2.3.1_1/include/gdal.h:45: /usr/local/Cellar/gdal/2.3.1_1/include/cpl_port.h:187:6: error: Must have C++11 or newer. # error Must have C++11 or newer. ^ 1 error generated. In file included from gdal_test.cc:1: In file included from /usr/local/Cellar/gdal/2.3.1_1/include/gdal.h:45: /usr/local/Cellar/gdal/2.3.1_1/include/cpl_port.h:187:6: error: Must have C++11 or newer. # error Must have C++11 or newer. ^ 1 error generated. configure: Install failure: compilation and/or linkage problems. configure: error: GDALAllRegister not found in libgdal. ERROR: configuration failed for package ?rgdal? * removing ?/usr/local/lib/R/3.5/site-library/rgdal? Warning in install.packages : installation of package ?rgdal? had non-zero exit status The downloaded source packages are in ?/private/var/folders/nv/k87rzvfs55l6j6xt_0jwb4wm0000gn/T/Rtmp68hYW1/downloaded_packages?