Closed Dekermanjian closed 3 years ago
Have you tried to reinstall sf?
install.packages("sf")
Hello. Yes, I have tried re-installing sf. I also tried removing it first, remove.packages("sf"), then re-installing it. Neither case worked.
Did you do a source install or a binary install?
I followed the instructions on the GitHub page and did a source install usinginstall.packages("sf", configure.args = "--with-proj-lib=/usr/local/lib/")
Please try install.packages("sf", type = "mac.binary")
It still returns the same error.
Here are gdal and pkg-config versions. If that helps at all.
Maybe your update was the problem?
Yes, that is likely the cause of the problem. Now the question is will all users who update to MacOS Big Sur at the end of the month experience the same problem or is this issue specific to my machine?
This issue indeed happened to me today when upgraded to Big Sur. After researching, finally I found a solution here:
https://stackoverflow.com/questions/64256675/copy-libpq-5-dylib-to-usr-lib-libpq-5-dylib
Looks like macOS is keeping libraries on /usr/lib
closed. Basically is needed to point back /usr/lib/libpq.5.dylib
against another libpq
, like the one you get by installing it with Homebrew.
This is what worked for me, first uninstall sf
and rgdal
packages in R and use HomeBrew to install libpq
if needed:
$ brew install libpq
Check if library is pointing itself:
$ otool -l /usr/local/Cellar/libpq/13.0/lib/libpq.5.dylib | fgrep -A2 LC_ID_DYLIB
If not, point it against itself:
$ sudo install_name_tool -id /usr/local/Cellar/libpq/13.0/lib/libpq.5.dylib /usr/local/Cellar/libpq/13.0/lib/libpq.5.dylib
And link the new path of libpq
to each R package binary that references to it:
$ sudo install_name_tool -change /usr/lib/libpq.5.dylib [new_path] [path_to_binary]
In this case, for sf
and rgdal
:
$ sudo install_name_tool -change /usr/lib/libpq.5.dylib /usr/local/Cellar/libpq/13.1/lib/libpq.5.dylib /Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so
$ sudo install_name_tool -change /usr/lib/libpq.5.dylib /usr/local/Cellar/libpq/13.1/lib/libpq.5.dylib /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgdal/libs/rgdal.so
This problem is now fixed on CRAN. You can install the packages from CRAN in the regular way.
the problem still persists when I try to install the RWeka package in R studio, R studio closes itself, the application crashes directly, what is my problem, although I have installed compatible java to the apple m1 processor, I encounter the same problem
@omerseze Please read recent threads on R-sig-mac https://stat.ethz.ch/mailman/listinfo/r-sig-mac, look in the archives, subscribe if you wish to ask there. This issue is closed and probably irrelevant for your problem.
The package was working well before I updated my Mac OS to the beta version of Big Sur. Now the package doesn't load. I am wondering if this is an OS incompatibility or if the update broke something. Through reading other Issue posts on the GitHub repo I tried brew install gdal and brew install jasper, neither worked. Below is an image of the error and the session info. Any help is greatly appreciated.