Install broom and spdep from source in MacOSX 12.2

I'm having trouble with :

install.packages("broom", type = "source") and install.packages("spdep", type = "source") in R 4.12 in MacOSX 12.2

The error message is:

Erreur dans dyn.load(file, DLLpath = DLLpath, ...) : 

  impossible de charger l'objet partagé '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/glue/libs/glue.so':

  dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/glue/libs/glue.so, 0x0006): Library not loaded: /usr/local/opt/gsl/lib/libgsl.25.dylib

  Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/glue/libs/glue.so

  Reason: tried: '/usr/local/opt/gsl/lib/libgsl.25.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libgsl.25.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre/lib/server/libgsl.25.dylib' (no such file), '/usr/local/Cellar/gsl/2.7.1/lib/libgsl.25.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libgsl.25.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre/lib/server/libgsl.25.dylib' (no such file)


The gsl library was just updated using brew.

Indeed libgsl.25.dylib was absent in the /usr/local/Cellar/gsl/2.7.1/lib folder but a libgsl.27.dylib was present.

cd /usr/local/Cellar/gsl/2.7.1/lib/

ls

libgsl.27.dylib libgslcblas.0.dylib pkgconfig  libgsl.a libgslcblas.a.  libgsl.dylib libgslcblas.dylib


The solution was to make a symbolic link of libgsl.dylib to libgsl.25.dylib (libgsl.dylib is a symbolic link to libgsl.27.dylib which is the most recent version):

In terminal:

cd /usr/local/Cellar/gsl/2.7.1/lib/

ln -s libgsl.dylib libgsl.25.dylib


And broom and spdep installation works in R.

I have no idea why the install of broom search for libgsl.25.dylib and not the generic name libgsl.dylib

Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04