Skip to content

Compilation failed on MacOSX #71

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

Closed
Marc-Girondot opened this issue Jan 6, 2022 · 1 comment
Closed

Compilation failed on MacOSX #71

Marc-Girondot opened this issue Jan 6, 2022 · 1 comment

Comments

@Marc-Girondot
Copy link

MacosX 12.1
R 4.12
While install spdep 1.2-1, it produced an error:
impossible de charger l'objet partagé '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/sf/libs/sf.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/sf/libs/sf.so, 0x0006): Library not loaded: /usr/local/opt/gdal/lib/libgdal.29.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/sf/libs/sf.so
Reason: tried: '/usr/local/opt/gdal/lib/libgdal.29.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libgdal.29.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre/lib/server/libgdal.29.dylib' (no such file), '/usr/local/Cellar/gdal/3.4.1/lib/libgdal.29.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libgdal.29.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre/lib/server/

It tried to use libgdal.29.dylib whereas libgdal.30.dylib is present:
√ lib % cd /usr/local/opt/gdal/lib/
√ lib % ls
libgdal.30.dylib libgdal.a libgdal.dylib pkgconfig python3.9
√ lib % ls -al
total 102952
drwxr-xr-x 7 marcgirondot staff 224 6 jan 09:23 .
drwxr-xr-x 10 marcgirondot staff 320 6 jan 08:23 ..
-rw-r--r-- 1 marcgirondot staff 18220456 6 jan 08:23 libgdal.30.dylib
-r--r--r-- 1 marcgirondot staff 34487256 27 déc 21:30 libgdal.a
lrwxr-xr-x 1 marcgirondot staff 16 27 déc 21:30 libgdal.dylib -> libgdal.30.dylib
drwxr-xr-x 3 marcgirondot staff 96 6 jan 08:23 pkgconfig
drwxr-xr-x 3 marcgirondot staff 96 27 déc 21:30 python3.9

If I try to make a symbolic link from libgdal.30.dylib to libgdal.29.dylib, it does not work either:
√ lib % sudo ln -s libgdal.30.dylib libgdal.29.dylib

Erreur : le chargement du package ou de l'espace de noms a échoué pour ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...) :
impossible de charger l'objet partagé '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/sf/libs/sf.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/sf/libs/sf.so, 0x0006): Symbol not found: __ZN10GDALDriver6CreateEPKciii12GDALDataTypePPc
Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/sf/libs/sf.so
Expected in: /usr/local/Cellar/gdal/3.4.1/lib/libgdal.30.dylib

The sf.so shared object is well in place.

cd /Library/Frameworks/R.framework/Versions/4.1/Resources/library/sf/libs/
√ libs % ls
sf.so

Any solution ?
Thanks
Marc Girondot

@rsbivand
Copy link
Member

rsbivand commented Jan 6, 2022

This is not an spdep issue. See r-spatial/sf#1848, and the resolution of never installing from source unless you know how to do it and need to do it to access the development versions of packages, or more recent versions of external software. See especially r-spatial/sf#1848 (comment) and following responses.

@rsbivand rsbivand closed this as completed Jan 6, 2022
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

2 participants