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

Error loading the package in Mac OS 10.16 #1502

Closed
Dekermanjian opened this issue Oct 2, 2020 · 13 comments
Closed

Error loading the package in Mac OS 10.16 #1502

Dekermanjian opened this issue Oct 2, 2020 · 13 comments

Comments

@Dekermanjian
Copy link

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.
Screen Shot 2020-10-02 at 8 29 30 AM

@Nowosad
Copy link
Contributor

Nowosad commented Oct 2, 2020

Have you tried to reinstall sf?

install.packages("sf")

@Dekermanjian
Copy link
Author

Hello. Yes, I have tried re-installing sf. I also tried removing it first, remove.packages("sf"), then re-installing it. Neither case worked.

@edzer
Copy link
Member

edzer commented Oct 2, 2020

Did you do a source install or a binary install?

@Dekermanjian
Copy link
Author

I followed the instructions on the GitHub page and did a source install using install.packages("sf", configure.args = "--with-proj-lib=/usr/local/lib/")

@edzer
Copy link
Member

edzer commented Oct 2, 2020

Please try install.packages("sf", type = "mac.binary")

@Dekermanjian
Copy link
Author

It still returns the same error.
Screen Shot 2020-10-02 at 10 14 38 AM

@Dekermanjian
Copy link
Author

Here are gdal and pkg-config versions. If that helps at all.
Screen Shot 2020-10-02 at 10 20 26 AM

@edzer
Copy link
Member

edzer commented Oct 2, 2020

Maybe your update was the problem?

@Dekermanjian
Copy link
Author

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?

@cris-silva
Copy link

cris-silva commented Nov 13, 2020

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

@jeroen
Copy link
Contributor

jeroen commented Nov 20, 2020

This problem is now fixed on CRAN. You can install the packages from CRAN in the regular way.

@omerseze
Copy link

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

@rsbivand
Copy link
Member

@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.

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

7 participants