Reputation: 121
I'm trying to load package gmm (running "library(gmm)") and get this error message below.
It seems unfixable, as it states that my gfortran/lib/libgomp.1.dylib has the wrong architecture? I'm guessing this is related to the new Mac architecture?
library(gmm) Loading required package: sandwich
Error: package or namespace load failed for ‘gmm’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/gmm/libs/gmm.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/gmm/libs/gmm.so, 6): Library not loaded: /usr/local/gfortran/lib/libgomp.1.dylib Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/gmm/libs/gmm.so
Reason: no suitable image found. Did find:
**/usr/local/gfortran/lib/libgomp.1.dylib: mach-o, but wrong architecture**
/usr/local/gfortran/lib/libgomp.1.dylib: mach-o, but wrong architecture
Upvotes: 2
Views: 1645
Reputation: 1
I encountered a similar issue after switching to a new Macbook Pro with the Apple M2 Max chip. The error that I got was:
Error: package or namespace load failed for ‘gmm’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/gmm/libs/gmm.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/gmm/libs/gmm.so, 0x0006): Library not loaded: /opt/R/arm64/gfortran/lib/libgomp.1.dylib
Referenced from: <47242657-5A5D-3982-936B-398527D642B4> /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/gmm/libs/gmm.so
Reason: tried: '/opt/R/arm64/gfortran/lib/libgomp.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/R/arm64/gfortran/lib/libgomp.1.dylib' (no such file), '/opt/R/arm64/gfortran/lib/libgomp.1.dylib' (no such file), '/usr/local/lib/libgomp.1.dylib' (no such file), '/usr/lib/libgomp.1.dylib' (no such file, not in dyld cache)
I tried the solution linked above as far as installing gfortran
and restarting R, but that did not work. Here was the solution that did work (after installing gfortran
):
mfind libgomp.1.dylib
. This will return the current location of the file./opt/R/arm64/
folder, but the subfolders gfortran and lib did not exist, so I created them. I had to enter my computer password for each change to this folder./opt/R/arm64/gfortran/lib/libgomp.1.dylib
.Hope this is helpful to someone out there with the same errors!
Upvotes: 0
Reputation: 71
I had the same issue on R version 4.1. Found a similar question here which points to installing (or updating) your gfortran
installation here. Once I did that and restarted R, the gmm
package was able to find the missing image(s) automatically when I loaded the package.
Upvotes: 1