Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, am not able to install "sf" in R; using macOS high sierra #680

Closed
sagar-m opened this issue Mar 20, 2018 · 22 comments
Closed

Hi, am not able to install "sf" in R; using macOS high sierra #680

sagar-m opened this issue Mar 20, 2018 · 22 comments

Comments

@sagar-m
Copy link

sagar-m commented Mar 20, 2018

The error is as below. Thank you so much.

``

install.packages("sf",dependencies = T)
also installing the dependencies ‘protolite’, ‘geojson’, ‘jqr’, ‘jsonvalidate’, ‘V8’, ‘geojsonio’, ‘geojsonlint’, ‘osmar’, ‘rmapshaper’, ‘XML’, ‘expm’, ‘viridis’, ‘gdtools’, ‘udunits2’, ‘deldir’, ‘tmaptools’, ‘spdep’, ‘leaflet’, ‘gdalUtils’, ‘svglite’, ‘units’, ‘classInt’, ‘lwgeom’, ‘rgdal’, ‘rgeos’, ‘spatstat’, ‘tmap’, ‘mapview’

trying URL 'https://cran.rstudio.com/src/contrib/protolite_1.7.tar.gz'
Content type 'application/x-gzip' length 16835 bytes (16 KB)
==================================================
downloaded 16 KB

trying URL 'https://cran.rstudio.com/src/contrib/geojson_0.2.0.tar.gz'
Content type 'application/x-gzip' length 1008918 bytes (985 KB)
==================================================
downloaded 985 KB

trying URL 'https://cran.rstudio.com/src/contrib/jqr_1.0.0.tar.gz'
Content type 'application/x-gzip' length 50196 bytes (49 KB)
==================================================
downloaded 49 KB

trying URL 'https://cran.rstudio.com/src/contrib/jsonvalidate_1.0.0.tar.gz'
Content type 'application/x-gzip' length 104657 bytes (102 KB)
==================================================
downloaded 102 KB

trying URL 'https://cran.rstudio.com/src/contrib/V8_1.5.tar.gz'
Content type 'application/x-gzip' length 327013 bytes (319 KB)
==================================================
downloaded 319 KB

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

trying URL 'https://cran.rstudio.com/src/contrib/geojsonlint_0.2.0.tar.gz'
Content type 'application/x-gzip' length 911798 bytes (890 KB)
==================================================
downloaded 890 KB

trying URL 'https://cran.rstudio.com/src/contrib/osmar_1.1-7.tar.gz'
Content type 'application/x-gzip' length 79505 bytes (77 KB)
==================================================
downloaded 77 KB

trying URL 'https://cran.rstudio.com/src/contrib/rmapshaper_0.3.0.tar.gz'
Content type 'application/x-gzip' length 743575 bytes (726 KB)
==================================================
downloaded 726 KB

trying URL 'https://cran.rstudio.com/src/contrib/XML_3.98-1.10.tar.gz'
Content type 'application/x-gzip' length 1599492 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/src/contrib/expm_0.999-2.tar.gz'
Content type 'application/x-gzip' length 136750 bytes (133 KB)
==================================================
downloaded 133 KB

trying URL 'https://cran.rstudio.com/src/contrib/viridis_0.5.0.tar.gz'
Content type 'application/x-gzip' length 1754678 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

trying URL 'https://cran.rstudio.com/src/contrib/gdtools_0.1.7.tar.gz'
Content type 'application/x-gzip' length 35268 bytes (34 KB)
==================================================
downloaded 34 KB

trying URL 'https://cran.rstudio.com/src/contrib/udunits2_0.13.tar.gz'
Content type 'application/x-gzip' length 67182 bytes (65 KB)
==================================================
downloaded 65 KB

trying URL 'https://cran.rstudio.com/src/contrib/deldir_0.1-14.tar.gz'
Content type 'application/x-gzip' length 73142 bytes (71 KB)
==================================================
downloaded 71 KB

trying URL 'https://cran.rstudio.com/src/contrib/tmaptools_1.2-3.tar.gz'
Content type 'application/x-gzip' length 80748 bytes (78 KB)
==================================================
downloaded 78 KB

trying URL 'https://cran.rstudio.com/src/contrib/spdep_0.7-4.tar.gz'
Content type 'application/x-gzip' length 1852930 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'https://cran.rstudio.com/src/contrib/leaflet_1.1.0.tar.gz'
Content type 'application/x-gzip' length 2415138 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

trying URL 'https://cran.rstudio.com/src/contrib/gdalUtils_2.0.1.7.tar.gz'
Content type 'application/x-gzip' length 1057639 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/src/contrib/svglite_1.2.1.tar.gz'
Content type 'application/x-gzip' length 41315 bytes (40 KB)
==================================================
downloaded 40 KB

trying URL 'https://cran.rstudio.com/src/contrib/units_0.5-1.tar.gz'
Content type 'application/x-gzip' length 836705 bytes (817 KB)
==================================================
downloaded 817 KB

trying URL 'https://cran.rstudio.com/src/contrib/classInt_0.1-24.tar.gz'
Content type 'application/x-gzip' length 19194 bytes (18 KB)
==================================================
downloaded 18 KB

trying URL 'https://cran.rstudio.com/src/contrib/lwgeom_0.1-4.tar.gz'
Content type 'application/x-gzip' length 432706 bytes (422 KB)
==================================================
downloaded 422 KB

trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.2-18.tar.gz'
Content type 'application/x-gzip' length 1650578 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cran.rstudio.com/src/contrib/rgeos_0.3-26.tar.gz'
Content type 'application/x-gzip' length 250574 bytes (244 KB)
==================================================
downloaded 244 KB

trying URL 'https://cran.rstudio.com/src/contrib/spatstat_1.55-0.tar.gz'
Content type 'application/x-gzip' length 6360605 bytes (6.1 MB)
==================================================
downloaded 6.1 MB

trying URL 'https://cran.rstudio.com/src/contrib/tmap_1.11-1.tar.gz'
Content type 'application/x-gzip' length 3886352 bytes (3.7 MB)
==================================================
downloaded 3.7 MB

trying URL 'https://cran.rstudio.com/src/contrib/mapview_2.3.0.tar.gz'
Content type 'application/x-gzip' length 1877698 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

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

* installing *source* package ‘protolite’ ...
** package ‘protolite’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=-I/usr/local/opt/protobuf/include
Using PKG_LIBS=-L/usr/local/opt/protobuf/lib -lprotobuf
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because protobuf was not found. Try installing:
 * deb: libprotobuf-dev (Debian, Ubuntu, etc)
 * rpm: protobuf-devel (Fedora, EPEL)
 * csw: protobuf_dev (Solaris)
 * brew: protobuf (OSX)
If protobuf is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a protobuf.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘protolite’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/protolite’
Warning in install.packages :
  installation of package ‘protolite’ had non-zero exit status
* installing *source* package ‘jqr’ ...
** package ‘jqr’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=-I/usr/local/opt/jq/include
Using PKG_LIBS=-L/usr/local/lib -ljq
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libjq was not found.
On Ubuntu 14.04 or 16.04 you can use the PPA:
  sudo add-apt-repository -y ppa:opencpu/jq
  sudo apt-get update
  sudo apt-get install libjq-dev
On other sytems try installing:
 * deb: libjq-dev (Debian, Ubuntu 16.10 and up).
 * rpm: jq-devel (Fedora, EPEL)
 * csw: libjq_dev (Solaris)
 * brew: jq (OSX)
If  is already installed set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘jqr’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/jqr’
Warning in install.packages :
  installation of package ‘jqr’ had non-zero exit status
* installing *source* package ‘V8’ ...
** package ‘V8’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=-I/usr/local/opt/v8@3.15/include
Using PKG_LIBS=-L/usr/local/opt/v8@3.15/lib -lv8
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because  was not found. Try installing:
 * deb: libv8-3.14-dev (formerly: libv8-dev) (Debian, Ubuntu)
 * rpm: v8-314-devel (formerly: v8-devel) (Fedora, EPEL)
 * brew: v8@3.15 (OSX) -- NOT regular v8! Tap from homebrew/versions
 * csw: libv8_dev (Solaris)
To use a custom libv8, set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘V8’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/V8’
Warning in install.packages :
  installation of package ‘V8’ had non-zero exit status
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-apple-darwin13.4.0-clang accepts -g... yes
checking for x86_64-apple-darwin13.4.0-clang option to accept ISO C89... none needed
checking how to run the C preprocessor... x86_64-apple-darwin13.4.0-clang -E
checking for sed... /usr/bin/sed
checking for pkg-config... no
checking for xml2-config... /Users/sherrymukim/anaconda3/bin/xml2-config
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 4 for 2.9.4
Located parser file -I/Users/sherrymukim/anaconda3/include/libxml2 -I/Users/sherrymukim/anaconda3/include/parser.h
Checking for 1.8:  -I/Users/sherrymukim/anaconda3/include/libxml2 -I/Users/sherrymukim/anaconda3/include
Using libxml2.*
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
You are trying to use a version 2.* edition of libxml
but an incompatible library. The header files and library seem to be
mismatched. If you have specified LIBXML_INCDIR, make certain to also
specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in the default
directories.
ERROR: configuration failed for package ‘XML’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/XML’
Warning in install.packages :
  installation of package ‘XML’ had non-zero exit status
* installing *source* package ‘expm’ ...
** package ‘expm’ successfully unpacked and MD5 sums checked
** libs
clang -I/Users/sherrymukim/anaconda3/lib/R/include -DNDEBUG   -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/sherrymukim/anaconda3/include   -fPIC  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/sherrymukim/anaconda3/include  -c R_dgebal.c -o R_dgebal.o
clang -I/Users/sherrymukim/anaconda3/lib/R/include -DNDEBUG   -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/sherrymukim/anaconda3/include   -fPIC  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/sherrymukim/anaconda3/include  -c expm-eigen.c -o expm-eigen.o
clang -I/Users/sherrymukim/anaconda3/lib/R/include -DNDEBUG   -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/sherrymukim/anaconda3/include   -fPIC  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/sherrymukim/anaconda3/include  -c expm.c -o expm.o
clang -I/Users/sherrymukim/anaconda3/lib/R/include -DNDEBUG   -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/sherrymukim/anaconda3/include   -fPIC  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/sherrymukim/anaconda3/include  -c init.c -o init.o
clang -I/Users/sherrymukim/anaconda3/lib/R/include -DNDEBUG   -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/sherrymukim/anaconda3/include   -fPIC  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/sherrymukim/anaconda3/include  -c logm-eigen.c -o logm-eigen.o
/Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran   -fPIC  -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -I/Users/sherrymukim/anaconda3/include -L/Users/sherrymukim/anaconda3/lib  -c matexp.f -o matexp.o
make: /Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran: No such file or directory
make: *** [matexp.o] Error 1
ERROR: compilation failed for package ‘expm’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/expm’
Warning in install.packages :
  installation of package ‘expm’ had non-zero exit status
* installing *source* package ‘viridis’ ...
** package ‘viridis’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error : object ‘cividis’ is not exported by 'namespace:viridisLite'
ERROR: lazy loading failed for package ‘viridis’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/viridis’
Warning in install.packages :
  installation of package ‘viridis’ had non-zero exit status
* installing *source* package ‘gdtools’ ...
** package ‘gdtools’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=-I/usr/local/opt/cairo/include/cairo
Using PKG_LIBS=-L/usr/local/opt/cairo/lib -lcairo
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because cairo was not found. Try installing:
 * deb: libcairo2-dev (Debian, Ubuntu)
 * rpm: cairo-devel (Fedora, CentOS, RHEL)
 * csw: libcairo_dev (Solaris)
 * brew: cairo (OSX)
If cairo is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a cairo.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘gdtools’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/gdtools’
Warning in install.packages :
  installation of package ‘gdtools’ had non-zero exit status
* installing *source* package ‘udunits2’ ...
** package ‘udunits2’ successfully unpacked and MD5 sums checked
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 for XML_ParserCreate in -lexpat... yes
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... 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 udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking for ut_read_xml in -ludunits2... no
-----Error: libudunits2.a not found-----
     If the udunits2 library is installed in a non-standard location,
     use --configure-args='--with-udunits2-lib=/usr/local/lib' for example,
     or --configure-args='--with-udunits2-include=/usr/include/udunits2'
     replacing paths with appropriate values for your installation.
     You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIB
     environment variables.
     If udunits2 is not installed, please install it.
     It is required for this package.
ERROR: configuration failed for package ‘udunits2’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/udunits2’
Warning in install.packages :
  installation of package ‘udunits2’ had non-zero exit status
* installing *source* package ‘deldir’ ...
** package ‘deldir’ successfully unpacked and MD5 sums checked
** libs
/Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran   -fPIC  -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -I/Users/sherrymukim/anaconda3/include -L/Users/sherrymukim/anaconda3/lib  -c acchk.f -o acchk.o
make: /Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran: No such file or directory
make: *** [acchk.o] Error 1
ERROR: compilation failed for package ‘deldir’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/deldir’
Warning in install.packages :
  installation of package ‘deldir’ had non-zero exit status
* installing *source* package ‘classInt’ ...
** package ‘classInt’ successfully unpacked and MD5 sums checked
** libs
/Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran   -fPIC  -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -I/Users/sherrymukim/anaconda3/include -L/Users/sherrymukim/anaconda3/lib  -c fish1.f -o fish1.o
make: /Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran: No such file or directory
make: *** [fish1.o] Error 1
ERROR: compilation failed for package ‘classInt’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/classInt’
Warning in install.packages :
  installation of package ‘classInt’ had non-zero exit status
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: x86_64-apple-darwin13.4.0-clang
configure: CXX: x86_64-apple-darwin13.4.0-clang++
configure: rgdal: 1.2-18
checking for /usr/bin/svnversion... yes
configure: svn revision: 718
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status
* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: x86_64-apple-darwin13.4.0-clang
configure: CXX: x86_64-apple-darwin13.4.0-clang++
configure: rgeos: 0.3-26
checking for /usr/bin/svnversion... yes
configure: svn revision: 560
checking for geos-config... no
no
configure: error: geos-config not found or not executable.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/rgeos’
Warning in install.packages :
  installation of package ‘rgeos’ had non-zero exit status
ERROR: dependencies ‘protolite’, ‘jqr’ are not available for package ‘geojson’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/geojson’
Warning in install.packages :
  installation of package ‘geojson’ had non-zero exit status
ERROR: dependency ‘V8’ is not available for package ‘jsonvalidate’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/jsonvalidate’
Warning in install.packages :
  installation of package ‘jsonvalidate’ had non-zero exit status
ERROR: dependency ‘XML’ is not available for package ‘osmar’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/osmar’
Warning in install.packages :
  installation of package ‘osmar’ had non-zero exit status
ERROR: dependencies ‘deldir’, ‘expm’ are not available for package ‘spdep’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/spdep’
Warning in install.packages :
  installation of package ‘spdep’ had non-zero exit status
ERROR: dependency ‘viridis’ is not available for package ‘leaflet’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/leaflet’
Warning in install.packages :
  installation of package ‘leaflet’ had non-zero exit status
ERROR: dependency ‘rgdal’ is not available for package ‘gdalUtils’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/gdalUtils’
Warning in install.packages :
  installation of package ‘gdalUtils’ had non-zero exit status
ERROR: dependency ‘gdtools’ is not available for package ‘svglite’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/svglite’
Warning in install.packages :
  installation of package ‘svglite’ had non-zero exit status
ERROR: dependency ‘udunits2’ is not available for package ‘units’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/units’
Warning in install.packages :
  installation of package ‘units’ had non-zero exit status
ERROR: dependency ‘deldir’ is not available for package ‘spatstat’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/spatstat’
Warning in install.packages :
  installation of package ‘spatstat’ had non-zero exit status
ERROR: dependencies ‘rgdal’, ‘rgeos’, ‘V8’, ‘geojson’, ‘jqr’ are not available for package ‘geojsonio’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/geojsonio’
Warning in install.packages :
  installation of package ‘geojsonio’ had non-zero exit status
ERROR: dependencies ‘jsonvalidate’, ‘V8’ are not available for package ‘geojsonlint’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/geojsonlint’
Warning in install.packages :
  installation of package ‘geojsonlint’ had non-zero exit status
ERROR: dependencies ‘units’, ‘classInt’ are not available for package ‘sf’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/sf’
Warning in install.packages :
  installation of package ‘sf’ had non-zero exit status
ERROR: dependencies ‘rgdal’, ‘V8’, ‘geojsonio’, ‘geojsonlint’ are not available for package ‘rmapshaper’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/rmapshaper’
Warning in install.packages :
  installation of package ‘rmapshaper’ had non-zero exit status
ERROR: dependencies ‘units’, ‘sf’ are not available for package ‘lwgeom’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/lwgeom’
Warning in install.packages :
  installation of package ‘lwgeom’ had non-zero exit status
ERROR: dependencies ‘leaflet’, ‘gdalUtils’, ‘sf’, ‘svglite’ are not available for package ‘mapview’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/mapview’
Warning in install.packages :
  installation of package ‘mapview’ had non-zero exit status
ERROR: dependencies ‘rgdal’, ‘rgeos’, ‘classInt’, ‘osmar’, ‘rmapshaper’, ‘spdep’, ‘XML’ are not available for package ‘tmaptools’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/tmaptools’
Warning in install.packages :
  installation of package ‘tmaptools’ had non-zero exit status
ERROR: dependencies ‘tmaptools’, ‘rgdal’, ‘rgeos’, ‘classInt’, ‘spdep’, ‘leaflet’, ‘mapview’ are not available for package ‘tmap’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/tmap’
Warning in install.packages :
  installation of package ‘tmap’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/p9/6qp4xp2536jdmxd8qkzkhp7m0000gn/T/Rtmp5Pyjud/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
``
@sagar-m
Copy link
Author

sagar-m commented Mar 20, 2018

Hi, tried following the steps on link

And getting the following error. Thank you.

mukim:anaconda3 sherrymukim$ R CMD INSTALL sf_0.6-0.tar.gz --configure-args='-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'
* installing to library ‘/Users/sherrymukim/anaconda3/lib/R/library’
ERROR: dependencies ‘units’, ‘classInt’ are not available for package ‘sf’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/sf’

@sagar-m
Copy link
Author

sagar-m commented Mar 20, 2018

`> install.packages("classInt")
trying URL 'https://cran.rstudio.com/src/contrib/classInt_0.1-24.tar.gz'
Content type 'application/x-gzip' length 19194 bytes (18 KB)
==================================================
downloaded 18 KB

* installing *source* package ‘classInt’ ...
** package ‘classInt’ successfully unpacked and MD5 sums checked
** libs
/Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran   -fPIC  -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -I/Users/sherrymukim/anaconda3/include -L/Users/sherrymukim/anaconda3/lib  -c fish1.f -o fish1.o
make: /Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran: No such file or directory
make: *** [fish1.o] Error 1
ERROR: compilation failed for package ‘classInt’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/classInt’
Warning in install.packages :
  installation of package ‘classInt’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/p9/6qp4xp2536jdmxd8qkzkhp7m0000gn/T/Rtmp5Pyjud/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done



> install.packages("units")
also installing the dependency ‘udunits2’

trying URL 'https://cran.rstudio.com/src/contrib/udunits2_0.13.tar.gz'
Content type 'application/x-gzip' length 67182 bytes (65 KB)
==================================================
downloaded 65 KB

trying URL 'https://cran.rstudio.com/src/contrib/units_0.5-1.tar.gz'
Content type 'application/x-gzip' length 836705 bytes (817 KB)
==================================================
downloaded 817 KB

* installing *source* package ‘udunits2’ ...
** package ‘udunits2’ successfully unpacked and MD5 sums checked
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 for XML_ParserCreate in -lexpat... yes
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... 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 udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking for ut_read_xml in -ludunits2... no
-----Error: libudunits2.a not found-----
     If the udunits2 library is installed in a non-standard location,
     use --configure-args='--with-udunits2-lib=/usr/local/lib' for example,
     or --configure-args='--with-udunits2-include=/usr/include/udunits2'
     replacing paths with appropriate values for your installation.
     You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIB
     environment variables.
     If udunits2 is not installed, please install it.
     It is required for this package.
ERROR: configuration failed for package ‘udunits2’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/udunits2’
Warning in install.packages :
  installation of package ‘udunits2’ had non-zero exit status
ERROR: dependency ‘udunits2’ is not available for package ‘units’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/units’
Warning in install.packages :
  installation of package ‘units’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/p9/6qp4xp2536jdmxd8qkzkhp7m0000gn/T/Rtmp5Pyjud/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done`

@rsbivand
Copy link
Member

If you don't understand your own system, install OSX binary CRAN packages. classInt and units are available. And sf is available for binary install from CRAN too. If your OSX is too new, move to a version that works, or to a more capable OS (even Windows is less of a problem for open source software).

@sagar-m
Copy link
Author

sagar-m commented Mar 20, 2018

Hi, I just downloaded and installed Xcode and yet I am getting the following error. Please assist. Thanks.

  > install.packages("classInt",dependencies = T)
   trying URL 'https://cran.rstudio.com/src/contrib/classInt_0.1-24.tar.gz'
   Content type 'application/x-gzip' length 19194 bytes (18 KB)
       

==================================================
downloaded 18 KB

* installing *source* package ‘classInt’ ...
** package ‘classInt’ successfully unpacked and MD5 sums checked
** libs
/Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran   -fPIC  -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -I/Users/sherrymukim/anaconda3/include -L/Users/sherrymukim/anaconda3/lib  -c fish1.f -o fish1.o
make: /Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran: No such file or directory
make: *** [fish1.o] Error 1
ERROR: compilation failed for package ‘classInt’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/classInt’
Warning in install.packages :
 installation of package ‘classInt’ had non-zero exit status

The downloaded source packages are in
   ‘/private/var/folders/p9/6qp4xp2536jdmxd8qkzkhp7m0000gn/T/RtmpENRNpn/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

@rsbivand
Copy link
Member

INSTALL BINARY!!!

@edzer
Copy link
Member

edzer commented Mar 20, 2018

Your problem has to do with not being able to install R source package on your platform. Please seek help somewhere else, and come back here when your problem has to do with the sf package.

@edzer edzer closed this as completed Mar 20, 2018
@sagar-m
Copy link
Author

sagar-m commented Mar 20, 2018

Hi @edzer , yes I will dig somewhere else :), I wrote here as I did not face this issue with "sp" and few other packages. Thanks!

Hi @rsbivand thanks for the suggestion. I tried binary, and both "classint" and "units" did not work. Probably got to do with R 3.4.2 version.

> install.packages("classInt",dependencies = T,type="mac.binary")
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/bin/macosx/contrib/3.4:
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/3.4/PACKAGES'

   package ‘classInt’ is available as a source package but not as a binary

Warning in install.packages :
  package ‘classInt’ is not available (as a binary package for R version 3.4.2)
> install.packages("units",dependencies = T,type="mac.binary")
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/bin/macosx/contrib/3.4:
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/3.4/PACKAGES'

   package ‘units’ is available as a source package but not as a binary

Warning in install.packages :
  package ‘units’ is not available (as a binary package for R version 3.4.2)

@rsbivand
Copy link
Member

Track https://cran.r-project.org/bin/macosx/, and https://stat.ethz.ch/pipermail/r-sig-mac/ for the latest difficulties. This could also be a mirror issue, as https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.4/classInt_0.1-24.tgz is present.

@sagar-m
Copy link
Author

sagar-m commented Mar 21, 2018

update: this link has a solution that worked for me. I was able to install "udunits2", and "units". However, they do not mention "ClassInt" and it is throwing an error. I will ask them, probably. Thank you.

`> install.packages('classInt')
trying URL 'https://cran.rstudio.com/src/contrib/classInt_0.1-24.tar.gz'
Content type 'application/x-gzip' length 19194 bytes (18 KB)
==================================================
downloaded 18 KB

* installing *source* package ‘classInt’ ...
** package ‘classInt’ successfully unpacked and MD5 sums checked
** libs
/Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran   -fPIC  -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -I/Users/sherrymukim/anaconda3/include -L/Users/sherrymukim/anaconda3/lib  -c fish1.f -o fish1.o
make: /Users/sherrymukim/anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran: No such file or directory
make: *** [fish1.o] Error 1
ERROR: compilation failed for package ‘classInt’
* removing ‘/Users/sherrymukim/anaconda3/lib/R/library/classInt’
Warning in install.packages :
  installation of package ‘classInt’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/p9/6qp4xp2536jdmxd8qkzkhp7m0000gn/T/RtmpENRNpn/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done`

@sagar-m
Copy link
Author

sagar-m commented Mar 21, 2018

Hi, I noticed that I have x86_64-apple-darwin15.5.0-gfortran but not x86_64-apple-darwin13.4.0-gfortran which is needed to install "ClassInt" package in R 3.4.2 on mac os 10.13.2. Any suggestions?

@rsbivand
Copy link
Member

Please do listen to what you are asked to do. Install binary only, or explain why you are still trying to install from source on a broken system. If you really wish to install from source, do follow the advice on the pages given, such as https://cran.r-project.org/bin/macosx/tools. This explains that Fortran from Apple is terminally broken, and gives remedies.

@rsbivand
Copy link
Member

From this thread: https://stat.ethz.ch/pipermail/r-sig-mac/2018-March/012684.html you'll see that many others are having difficulties at the moment. Ensure that you are really installing binary, and visit the package pages on CRAN to ensure that all the packages the target package uses are installed in updated form. A lot of the difficulties seem to have come from Apple's bipolar issue (they are dreadfully lax on security, so obfuscate by enforcing costly certification on the installation of third-party software as if wasn't to blame itself - recall the no-password root login scandal).

@jeroen
Copy link
Contributor

jeroen commented Mar 21, 2018

@sagar-m if you use the recommended R for mac, everything will work out of the box. If you really want to use the anaconda version of R, you better ask your question over there, this is a problem with their setup.

@sagar-m
Copy link
Author

sagar-m commented Mar 21, 2018

@jeroen that was an excellent suggestion. I do have R for mac, but because I use Anaconda for spyder (python), and they have R studio too, thus I was using it. I was able to download sf (binary), and "ClassInt" (source) using R for mac. Thank you very much.

@rsbivand I was able to download sf (binary), and "ClassInt" (source) using R for mac. Thank you very much. In this process, I learnt many new things.

@v-ca
Copy link

v-ca commented Nov 9, 2020

Please do listen to what you are asked to do. Install binary only, or explain why you are still trying to install from source on a broken system. If you really wish to install from source, do follow the advice on the pages given, such as https://cran.r-project.org/bin/macosx/tools. This explains that Fortran from Apple is terminally broken, and gives remedies.

This person is the most unhelpful, unknowledgeable... I'll leave out colorful language... person I've had the misfortunate of coming across on here. I know this is an old thread and I'm sure you've moved on but for anyone else, this worked for me:

(After installing units) To install classInt for mac:
Go to: https://cran.r-project.org/bin/macosx/tools/
Then: download and install "gfortran-6.1.pkg (OS X 10.11+, signed, 64-bit)"
When that's done go to: https://github.com/r-spatial/sf and follow the instructions for mac OR
Run this in RStudio: install.packages("sf", configure.args = "--with-proj-lib=/usr/local/lib/")

@edzer
Copy link
Member

edzer commented Nov 9, 2020

@v-ca please do respect the code of conduct of this repo.

@v-ca
Copy link

v-ca commented Nov 9, 2020

@edzer nothing I said violated a code of conduct, and you may want to reprimand rsbivand, unless you're ok with how that ...gentleman... spoke to a user just trying to get help with something they obviously were having trouble with.

@gulinan
Copy link

gulinan commented May 4, 2021

@v-ca I followed your suggestions and it totally worked out!..Thank you very much for your help!..

@bradpr
Copy link

bradpr commented Nov 16, 2021

I am just learning about spatial visualization in R and attempted to load the sf package on my Mac as part of my studies.

I encountered the same error that @sagar-m did, and was encouraged upon finding this thread that I found a solution...until I read the comments from @rsbivand and @edzer.

Guys, we are not all as awesome at this stuff as you seem to think you are. I hope the tone of your comments to @sagar-m were the result of not speaking English as a primary language. I hope that you don't take that tone with everyone who comes here asking for help. You're driving people away if you do.

fwiw - I solved my issue by following @rsbivand 's blunt instruction to "INSTALL BINARY!!!", although it was completely by accident.

When attempting to install sf in my instance of R Studio, I received the following prompt:

"Do you want to install from sources the package which needs compilation? (Yes/No/Cancel)"

After reading the harsh and critical comments on this thread, I was able to get context on this somewhat cryptic message. I understood that installing this as a compiled package on my Mac was part of the issue, so I chose "No". What the above prompt fails to communicate is that selecting "No" will "INSTALL BINARY!!!" The first 10 times I went past that prompt, I thought that selecting "No" would abort installation, so I chose "Yes" and got the error @sagar-m referenced.

Bottom line: If you are attempting to install sf in R Studio on a Mac, choose "No" when you receive the above prompt.

Also, don't be discouraged by grumpy community members who belittle you for not being as cool as they are. Press forward, learn, and share your experiences.

@sagar-m , good on you for demonstrating the poise that you did, in spite of the comments you received in response to your request for help. You inspire me to show more restraint in the face of mean people.

@rsbivand
Copy link
Member

rsbivand commented Nov 17, 2021

@bradpr After unsuccessful attempts to explain why source installations of R packages with compiled C/C++/Fortran code are very much more demanding when external software is involved, I felt that shouting (all caps) was less harmful than leaving the questioner without help.

Much of the trouble has come about as the default for installation type on Windows and most macOS versions of R is now "both", having earlier been "binary". The change makes it easier for users to keep packages fully updated if the packages themselves have no dependencies on external software, and if they have XCode etc. or Rtoools40 installed. But it creates the trap that users are led to think from experience with packages without external software dependencies that they may safely answer "yes" to the challenge on source install. "yes" gives the very latest package, "no" the latest version available as binary, which given latency in building binary packages on the archive network, may yield a gap of at least several days for people getting trapped.

We tried to explore having a by-package specification to insert "binary" as default if packages required external software, but because both Rtools40 (and forthcoming Rtools42) provide mechanisms to provide the possibly missing software components built with the same compilers and linkers as R itself (so linking the package compiled code including all the external dependencies with R itself safely), only macOS was left as exposed. Similar mechanisms are present for macOS, but they require user intervention, so are far more demanding.

So on balance the only sensible advice to macOS users with installation problems for packages like sf is to install binary, unless the users feel very confident about their software and system management competences. Of course, one should encourage people to enhance competences, but this implies that they really want to know, and have the time to learn stuff they may never need to use ever again.

One cannot know whether a questioner is interested in making that major commitment, so the "kindest" fallback for macOS is install.packages("sf", type="binary"), which only assumes that the user needs to get a working version of the package installed to accomplish tasks at hand. Like most teachers, I find that voice volume is a tool that is sometimes the most appropriate to resolve an immediate problem.

@JacobusS
Copy link

I know that I'm very late to the conversation.

I just had the same issue,
Here is a solution that worked for me, maybe it can be helpful to someone else who reads this in future:
Presuming that you are using Ubuntu, run the following terminal:
sudo apt install libudunits2-dev

Then in R:
install.packages("units")
install.packages("sf")

No need to install from binary and all that.
Hope it can help

@cubouldermark
Copy link

I know that I'm very late to the conversation.

For me, you were just in time. Thank you.

On Linux Mint 20 (Ubuntu 20 derivative), I also needed another library to install. With libudunits2-dev and libgdal-dev I was able to install.

sudo apt install libgdal-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants