Closed baggiponte closed 3 years ago
Based on this error:
dlopen(/Users/luca/Library/Application Support/renv/cache/v5/R-4.0/x86_64-apple-darwin20.3.0/Rcpp/1.0.6/dbb5e436998a7eba5a9d682060533338/Rcpp/libs/Rcpp.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/10/libstdc++.6.dylib
Does this library (/usr/local/opt/gcc/lib/gcc/10/libstdc++.6.dylib
) still exist, or was it removed when you updated gcc
? I suspect it's gone now since /usr/local/opt
normally only contains the "current" version of a particular Homebrew package.
You could probably fix this with install_name_tool
; e.g. with something like:
install_name_tool -change \
/usr/local/opt/gcc/lib/gcc/10/libstdc++.6.dylib \
/usr/local/opt/gcc/lib/gcc/11/libstdc++.6.dylib \
/Users/luca/Library/Application Support/renv/cache/v5/R-4.0/x86_64-apple-darwin20.3.0/Rcpp/1.0.6/dbb5e436998a7eba5a9d682060533338/Rcpp/libs/Rcpp.so
(alternatively, use install_name_tool
to fix the library path to wherever gcc@10
lives in your /usr/local/Cellar
directory)
But this would likely need to be done for any package that had been installed with an older version of gcc
.
FWIW, my understanding is that the Homebrew solution to this issue is to force any dependent packages to be rebuilt and reinstalled when gcc is updated, so one could argue this also applies transitively to any installed R packages as well (if you're using Homebrew gcc + Homebrew R).
Hi @kevinushey, thank you for your time and detailed answer!
I suspect it's gone now since /usr/local/opt normally only contains the "current" version of a particular Homebrew package.
Your suspects are correct!
In the end I just uninstalled r
and reinstalled it. As Homebrew says:
The R Project provides official binaries:
brew install --cask r
Alternatively, the Homebrew-compiled version of R omits the GUI app:brew install r
Of course, I had installed the Homebrew-compiled one (which everybody seems to be using, tbh). It was brutal, indeed. But I could not even load some libraries (I tried to library(tidyverse)
and it spat out an error message) and now everything works (also thanks to a famous Stackoverflow answer you gave about gfortran
).
I am not sure if this will be useful to anyone someday. It is clear it had nothing to do with httpuv
in the first place - perhaps it was sourced by updating r
to 4.0.5
and incidentally by {renv}
.
Problem
Hello! I am using R 4.0.5 on macOS Big Sur 10.16 (am using Homebrew as package manager) and I am trying to update the packages of a
{renv}
environment. Among these, there is{httpuv}
which requires updating from1.6.0 -> 1.6.1
. However, the following error appears:What I tried
First, I tried to regularly compile it with
g++ 11
, the latest version I have installed. Then I installedg++ 10
and tried with that. To do so, I edited my.r/Makevars
to look like this:In this way I could use
g++-10
, but this did not change anything.Since the error message says
unable to load shared object '/Users/luca/Library/Application Support/renv/cache/v5/R-4.0/x86_64-apple-darwin20.3.0/Rcpp/1.0.6/dbb5e436998a7eba5a9d682060533338/Rcpp/libs/Rcpp.so':
, I attachedRcpp
and tried to install it again, to no avail.I also tried to install the dev version with `renv::install('rstudio/httpuv') but the same problem occurred. Perhaps @kevinushey has something to say about it?
Thanks!
Session Info
My
sessionInfo()
is: