Issues with tidyverse package dependencies

Hi there, I'm trying to install packages such as tidyverse, mapedit, and mapview. However, I'm having trouble installing all the components of these packages ever since I updated my OS as I'm getting a number of errors that I do not necessarily know how to remedy. Any help / advice would greatly be appreciated.

Here are a few of my current specs:

MacOS Big Sur 11.3
Xcode version 12.5 (12E262) (most up to date)
R version 4.0.5 (2021-03-31)

Specifically, when I install.packages("tidyverse"), there are 6 warnings that are produced:

Warning messages:
1: In install.packages("tidyverse") :
  installation of package ‘data.table’ had non-zero exit status
2: In install.packages("tidyverse") :
  installation of package ‘haven’ had non-zero exit status
3: In install.packages("tidyverse") :
  installation of package ‘xml2’ had non-zero exit status
4: In install.packages("tidyverse") :
  installation of package ‘dtplyr’ had non-zero exit status
5: In install.packages("tidyverse") :
  installation of package ‘rvest’ had non-zero exit status
6: In install.packages("tidyverse") :
  installation of package ‘tidyverse’ had non-zero exit status

Whenever, I try to install each of them independently, the errors seem to be similar for each of them. I'm including the error for install.packages("data.table") (given the character limit of posting).

> install.packages("data.table")
Installing package into ‘/usr/local/lib/R/4.0/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/data.table_1.14.0.tar.gz'
Content type 'application/x-gzip' length 5303849 bytes (5.1 MB)
==================================================
downloaded 5.1 MB

* installing *source* package ‘data.table’ ...
** package ‘data.table’ successfully unpacked and MD5 sums checked
** using staged installation
zlib 1.2.8 is available ok
R CMD SHLIB supports OpenMP without any extra hint
** libs
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c assign.c -o assign.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c between.c -o between.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c bmerge.c -o bmerge.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c chmatch.c -o chmatch.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c cj.c -o cj.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c coalesce.c -o coalesce.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c dogroups.c -o dogroups.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c fastmean.c -o fastmean.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c fcast.c -o fcast.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c fifelse.c -o fifelse.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c fmelt.c -o fmelt.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c forder.c -o forder.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c frank.c -o frank.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c fread.c -o fread.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c freadR.c -o freadR.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c froll.c -o froll.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c frollR.c -o frollR.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c frolladaptive.c -o frolladaptive.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c fsort.c -o fsort.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c fwrite.c -o fwrite.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c fwriteR.c -o fwriteR.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c gsumm.c -o gsumm.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c ijoin.c -o ijoin.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c init.c -o init.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c inrange.c -o inrange.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c nafill.c -o nafill.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c nqrecreateindices.c -o nqrecreateindices.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c openmp-utils.c -o openmp-utils.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c quickselect.c -o quickselect.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c rbindlist.c -o rbindlist.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c reorder.c -o reorder.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c shift.c -o shift.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c snprintf.c -o snprintf.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c subset.c -o subset.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c transpose.c -o transpose.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c types.c -o types.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c uniqlist.c -o uniqlist.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c utils.c -o utils.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c vecseq.c -o vecseq.o
clang -I"/usr/local/Cellar/r/4.0.5/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include    -fPIC  -Wno-implicit-function-declaration  -c wrappers.c -o wrappers.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/4.0.5/lib/R/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/xz/lib -L/usr/local/lib -o data.table.so assign.o between.o bmerge.o chmatch.o cj.o coalesce.o dogroups.o fastmean.o fcast.o fifelse.o fmelt.o forder.o frank.o fread.o freadR.o froll.o frollR.o frolladaptive.o fsort.o fwrite.o fwriteR.o gsumm.o ijoin.o init.o inrange.o nafill.o nqrecreateindices.o openmp-utils.o quickselect.o rbindlist.o reorder.o shift.o snprintf.o subset.o transpose.o types.o uniqlist.o utils.o vecseq.o wrappers.o -lz -L/usr/local/Cellar/r/4.0.5/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
PKG_CFLAGS =
PKG_LIBS = -lz
if [ "data.table.so" != "datatable.so" ]; then mv data.table.so datatable.so; fi
if [ "" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then install_name_tool -id datatable.so datatable.so; fi
installing to /usr/local/lib/R/4.0/site-library/00LOCK-data.table/00new/data.table/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘data.table’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/4.0/site-library/00LOCK-data.table/00new/data.table/libs/datatable.so':
  dlopen(/usr/local/lib/R/4.0/site-library/00LOCK-data.table/00new/data.table/libs/datatable.so, 6): Library not loaded: /opt/local/lib/libgcc/libgcc_s.1.dylib
  Referenced from: /usr/local/lib/libz.1.dylib
  Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/4.0/site-library/data.table’

The downloaded source packages are in
	‘/private/var/folders/c0/7rr5r8k523s8qkm3dncxp23r0000gn/T/RtmpqnqDIB/downloaded_packages’
Warning message:
In install.packages("data.table") :
  installation of package ‘data.table’ had non-zero exit status

While I mainly use R for getting graphs and analyzing data, hopefully one of the much more savvy folks on here can help me triage these errors :slight_smile: Please do not hesitate to ask me any questions or highlight any concerns. Thanks!

It seems there is a problem with your gcc compiler, I would suggest checking that the recommended development tools for macOS systems are properly installed.
https://cran.r-project.org/bin/macosx/tools/

Or, trying to install precompiled binaries.

1 Like

Thanks for the suggestion.
Unfortunately, it still looks like I'm getting this error despite ensuring that all my development tools are up to date (including the new gfortran 10.2 for Big Sur (macOS 11), for Intel processors (Release gfortran 10.2 for Big Sur (macOS 11), for Intel processors · fxcoudert/gfortran-for-macOS · GitHub). I tried to uninstall and reinstall the compilers but to no avail :confused: