Hi, I installed R 4.10 on my Mac OS 11.3.1 I am trying to install 'sf' and 'rgdal'
sf installation problem under Mac OS 11 - Big Sur
4 messages · Simon Urbanek, Brian Ripley, Michal Ben-Nun
Michal, those instructions work for released CRAN R. Apparently, that's not what you are using - if you want to compile sf and gdal from sources, that is more challenging and you have to install all its dependencies first. In the output below you're missing at the very least the PROJ4/6 library - it may not be the only thing you're missing, so make sure you read the errors and install all necessary dependencies. Cheers, Simon
On Aug 19, 2021, at 10:52 AM, Michal Ben-Nun <mbennun at predsci.com> wrote:
Hi,
I installed R 4.10 on my Mac OS 11.3.1
I am trying to install 'sf' and 'rgdal'
From the mailing list I understood that this command should work:
install.packages(c("rgdal","sf"),,"https://mac.R-project.org
<https://mac.r-project.org/>")
However I am still getting an error, see below.
Any suggestions would be welcome.
Thanks,
Michal
p.s. I am using macports NOT brew
install.packages(c("rgdal","sf"),,"https://mac.R-project.org")
Installing packages into ?/Users/michal/Library/R/x86_64/4.1/library? (as ?lib? is unspecified) trying URL 'https://mac.R-project.org/src/contrib/rgdal_1.5-23.tar.gz' Content type 'application/octet-stream' length 4393536 bytes (4.2 MB) ================================================== downloaded 4.2 MB trying URL 'https://mac.R-project.org/src/contrib/sf_1.0-2.tar.gz' Content type 'application/octet-stream' length 3645982 bytes (3.5 MB) ================================================== downloaded 3.5 MB * installing *source* package ?rgdal? ... ** package ?rgdal? successfully unpacked and MD5 sums checked ** using staged installation configure: R_HOME: /opt/local/Library/Frameworks/R.framework/Resources configure: CC: /opt/local/bin/clang-mp-12 configure: CXX: /opt/local/bin/clang++-mp-12 -std=gnu++14 configure: CFLAGS: -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 configure: CPPFLAGS: -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk configure: CXXFLAGS: -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 configure: LDFLAGS: -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 configure: LDFLAGS: -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 configure: CXX11 is: /opt/local/bin/clang++-mp-12, CXX11STD is: -std=gnu++11 configure: CXX is: /opt/local/bin/clang++-mp-12 -std=gnu++11 configure: C++11 support available configure: rgdal: 1.5-23 checking for /usr/bin/svnversion... no configure: svn revision: 1121 checking for gdal-config... /opt/local/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 3.3.0 checking GDAL version >= 1.11.4... yes checking GDAL version <= 2.5 or >= 3.0... yes checking GDAL: linking with --libs only... yes checking GDAL: gdal-config data directory readable... yes checking GDAL: /opt/local/share/gdal/stateplane.csv readable... yes configure: pkg-config proj not available set PKG_CONFIG_PATH to the directory containing proj.pc configure: PROJ version not determined using pkg-config proj configure: PROJ CPP flags: -I/opt/local/include configure: PROJ LIBS: -lproj checking PROJ header API:... yes configure: API to be used as yet undetermined, searching ... configure: error: API to be used not found ERROR: configuration failed for package ?rgdal? * removing ?/Users/michal/Library/R/x86_64/4.1/library/rgdal? * installing *source* package ?sf? ... ** package ?sf? successfully unpacked and MD5 sums checked ** using staged installation configure: CC: /opt/local/bin/clang-mp-12 configure: CXX: /opt/local/bin/clang++-mp-12 -std=gnu++11 checking for gdal-config... /opt/local/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 3.3.0 checking GDAL version >= 2.0.1... yes checking for gcc... /opt/local/bin/clang-mp-12 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 /opt/local/bin/clang-mp-12 accepts -g... yes checking for /opt/local/bin/clang-mp-12 option to accept ISO C89... none needed checking how to run the C preprocessor... /opt/local/bin/clang-mp-12 -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... 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: /opt/local/share/gdal/pcs.csv readable... no checking GDAL: checking whether PROJ is available for linking:... yes checking GDAL: checking whether PROJ is available fur running:... yes configure: GDAL: 3.3.0 checking proj.h usability... no checking proj.h presence... no checking for proj.h... no checking proj_api.h usability... no checking proj_api.h presence... no checking for proj_api.h... no configure: error: proj_api.h not found in standard or given locations. ERROR: configuration failed for package ?sf? * removing ?/Users/michal/Library/R/x86_64/4.1/library/sf? The downloaded source packages are in ?/private/var/folders/07/47hs0f_j187393z5drwshbm00000gn/T/RtmpsD9V5a/downloaded_packages? Warning messages: 1: In install.packages(c("rgdal", "sf"), , "https://mac.R-project.org") : installation of package ?rgdal? had non-zero exit status 2: In install.packages(c("rgdal", "sf"), , "https://mac.R-project.org") : installation of package ?sf? had non-zero exit status [[alternative HTML version deleted]]
_______________________________________________ R-SIG-Mac mailing list R-SIG-Mac at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac
On 18/08/2021 23:52, Michal Ben-Nun wrote:
Hi, I installed R 4.10 on my Mac OS 11.3.1
Presumably R 4.1.0.
I am trying to install 'sf' and 'rgdal'
From the mailing list I understood that this command should work:
install.packages(c("rgdal","sf"),,"https://mac.R-project.org
<https://mac.r-project.org/>")
However I am still getting an error, see below.
Any suggestions would be welcome.
Thanks,
Michal
p.s. I am using macports NOT brew
Asking on R-sig-geo would be appropriate as macports/Homebrew are generic Unix-alike systems. Hint: rgdal has SystemRequirements: PROJ (>= 4.8.0, https://proj.org/download.html) and GDAL (>= 1.11.4, https://gdal.org/download.html), with versions either (A) PROJ < 6 and GDAL < 3 or (B) PROJ >= 6 and GDAL >= 3. and it seems you have not installed PROJ
install.packages(c("rgdal","sf"),,"https://mac.R-project.org")
Installing packages into ?/Users/michal/Library/R/x86_64/4.1/library? (as ?lib? is unspecified) trying URL 'https://mac.R-project.org/src/contrib/rgdal_1.5-23.tar.gz' Content type 'application/octet-stream' length 4393536 bytes (4.2 MB) ================================================== downloaded 4.2 MB trying URL 'https://mac.R-project.org/src/contrib/sf_1.0-2.tar.gz' Content type 'application/octet-stream' length 3645982 bytes (3.5 MB) ================================================== downloaded 3.5 MB * installing *source* package ?rgdal? ... ** package ?rgdal? successfully unpacked and MD5 sums checked ** using staged installation configure: R_HOME: /opt/local/Library/Frameworks/R.framework/Resources configure: CC: /opt/local/bin/clang-mp-12 configure: CXX: /opt/local/bin/clang++-mp-12 -std=gnu++14 configure: CFLAGS: -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 configure: CPPFLAGS: -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk configure: CXXFLAGS: -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 configure: LDFLAGS: -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 configure: LDFLAGS: -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 configure: CXX11 is: /opt/local/bin/clang++-mp-12, CXX11STD is: -std=gnu++11 configure: CXX is: /opt/local/bin/clang++-mp-12 -std=gnu++11 configure: C++11 support available configure: rgdal: 1.5-23 checking for /usr/bin/svnversion... no configure: svn revision: 1121 checking for gdal-config... /opt/local/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 3.3.0 checking GDAL version >= 1.11.4... yes checking GDAL version <= 2.5 or >= 3.0... yes checking GDAL: linking with --libs only... yes checking GDAL: gdal-config data directory readable... yes checking GDAL: /opt/local/share/gdal/stateplane.csv readable... yes configure: pkg-config proj not available set PKG_CONFIG_PATH to the directory containing proj.pc configure: PROJ version not determined using pkg-config proj configure: PROJ CPP flags: -I/opt/local/include configure: PROJ LIBS: -lproj checking PROJ header API:... yes configure: API to be used as yet undetermined, searching ... configure: error: API to be used not found ERROR: configuration failed for package ?rgdal? * removing ?/Users/michal/Library/R/x86_64/4.1/library/rgdal? * installing *source* package ?sf? ... ** package ?sf? successfully unpacked and MD5 sums checked ** using staged installation configure: CC: /opt/local/bin/clang-mp-12 configure: CXX: /opt/local/bin/clang++-mp-12 -std=gnu++11 checking for gdal-config... /opt/local/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 3.3.0 checking GDAL version >= 2.0.1... yes checking for gcc... /opt/local/bin/clang-mp-12 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 /opt/local/bin/clang-mp-12 accepts -g... yes checking for /opt/local/bin/clang-mp-12 option to accept ISO C89... none needed checking how to run the C preprocessor... /opt/local/bin/clang-mp-12 -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... 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: /opt/local/share/gdal/pcs.csv readable... no checking GDAL: checking whether PROJ is available for linking:... yes checking GDAL: checking whether PROJ is available fur running:... yes configure: GDAL: 3.3.0 checking proj.h usability... no checking proj.h presence... no checking for proj.h... no checking proj_api.h usability... no checking proj_api.h presence... no checking for proj_api.h... no configure: error: proj_api.h not found in standard or given locations. ERROR: configuration failed for package ?sf? * removing ?/Users/michal/Library/R/x86_64/4.1/library/sf? The downloaded source packages are in ?/private/var/folders/07/47hs0f_j187393z5drwshbm00000gn/T/RtmpsD9V5a/downloaded_packages? Warning messages: 1: In install.packages(c("rgdal", "sf"), , "https://mac.R-project.org") : installation of package ?rgdal? had non-zero exit status 2: In install.packages(c("rgdal", "sf"), , "https://mac.R-project.org") : installation of package ?sf? had non-zero exit status [[alternative HTML version deleted]]
_______________________________________________ R-SIG-Mac mailing list R-SIG-Mac at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford
I was able to install the packages after setting the environment variable PKG_CONFIG_PATH to the location of proj.pc On Wed, Aug 18, 2021 at 11:20 PM Simon Urbanek <simon.urbanek at r-project.org> wrote:
Michal, those instructions work for released CRAN R. Apparently, that's not what you are using - if you want to compile sf and gdal from sources, that is more challenging and you have to install all its dependencies first. In the output below you're missing at the very least the PROJ4/6 library - it may not be the only thing you're missing, so make sure you read the errors and install all necessary dependencies. Cheers, Simon
On Aug 19, 2021, at 10:52 AM, Michal Ben-Nun <mbennun at predsci.com>
wrote:
Hi,
I installed R 4.10 on my Mac OS 11.3.1
I am trying to install 'sf' and 'rgdal'
From the mailing list I understood that this command should work:
install.packages(c("rgdal","sf"),,"https://mac.R-project.org
<https://mac.r-project.org/>")
However I am still getting an error, see below.
Any suggestions would be welcome.
Thanks,
Michal
p.s. I am using macports NOT brew
install.packages(c("rgdal","sf"),,"https://mac.R-project.org")
Installing packages into ?/Users/michal/Library/R/x86_64/4.1/library? (as ?lib? is unspecified) trying URL 'https://mac.R-project.org/src/contrib/rgdal_1.5-23.tar.gz' Content type 'application/octet-stream' length 4393536 bytes (4.2 MB) ================================================== downloaded 4.2 MB trying URL 'https://mac.R-project.org/src/contrib/sf_1.0-2.tar.gz' Content type 'application/octet-stream' length 3645982 bytes (3.5 MB) ================================================== downloaded 3.5 MB * installing *source* package ?rgdal? ... ** package ?rgdal? successfully unpacked and MD5 sums checked ** using staged installation configure: R_HOME: /opt/local/Library/Frameworks/R.framework/Resources configure: CC: /opt/local/bin/clang-mp-12 configure: CXX: /opt/local/bin/clang++-mp-12 -std=gnu++14 configure: CFLAGS: -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch
x86_64
configure: CPPFLAGS: -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk configure: CXXFLAGS: -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch
x86_64
configure: LDFLAGS: -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
-arch
x86_64 configure: LDFLAGS: -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
-arch
x86_64 configure: CXX11 is: /opt/local/bin/clang++-mp-12, CXX11STD is:
-std=gnu++11
configure: CXX is: /opt/local/bin/clang++-mp-12 -std=gnu++11 configure: C++11 support available configure: rgdal: 1.5-23 checking for /usr/bin/svnversion... no configure: svn revision: 1121 checking for gdal-config... /opt/local/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 3.3.0 checking GDAL version >= 1.11.4... yes checking GDAL version <= 2.5 or >= 3.0... yes checking GDAL: linking with --libs only... yes checking GDAL: gdal-config data directory readable... yes checking GDAL: /opt/local/share/gdal/stateplane.csv readable... yes configure: pkg-config proj not available set PKG_CONFIG_PATH to the directory containing proj.pc configure: PROJ version not determined using pkg-config proj configure: PROJ CPP flags: -I/opt/local/include configure: PROJ LIBS: -lproj checking PROJ header API:... yes configure: API to be used as yet undetermined, searching ... configure: error: API to be used not found ERROR: configuration failed for package ?rgdal? * removing ?/Users/michal/Library/R/x86_64/4.1/library/rgdal? * installing *source* package ?sf? ... ** package ?sf? successfully unpacked and MD5 sums checked ** using staged installation configure: CC: /opt/local/bin/clang-mp-12 configure: CXX: /opt/local/bin/clang++-mp-12 -std=gnu++11 checking for gdal-config... /opt/local/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 3.3.0 checking GDAL version >= 2.0.1... yes checking for gcc... /opt/local/bin/clang-mp-12 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 /opt/local/bin/clang-mp-12 accepts -g... yes checking for /opt/local/bin/clang-mp-12 option to accept ISO C89... none needed checking how to run the C preprocessor... /opt/local/bin/clang-mp-12 -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... 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: /opt/local/share/gdal/pcs.csv readable... no checking GDAL: checking whether PROJ is available for linking:... yes checking GDAL: checking whether PROJ is available fur running:... yes configure: GDAL: 3.3.0 checking proj.h usability... no checking proj.h presence... no checking for proj.h... no checking proj_api.h usability... no checking proj_api.h presence... no checking for proj_api.h... no configure: error: proj_api.h not found in standard or given locations. ERROR: configuration failed for package ?sf? * removing ?/Users/michal/Library/R/x86_64/4.1/library/sf? The downloaded source packages are in
?/private/var/folders/07/47hs0f_j187393z5drwshbm00000gn/T/RtmpsD9V5a/downloaded_packages?
Warning messages:
1: In install.packages(c("rgdal", "sf"), , "https://mac.R-project.org")
:
installation of package ?rgdal? had non-zero exit status
2: In install.packages(c("rgdal", "sf"), , "https://mac.R-project.org")
:
installation of package ?sf? had non-zero exit status
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Mac mailing list R-SIG-Mac at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac