Hello, I am trying to install the impute() package to use the WGCNA package, for which it is a dependency. I am using an M1 Mac with macOS Monterrey.
Initially, I had an issue with installing the package because of an issue with gfortran
that I solved by following the solution posted on this StackOverflow page: https://stackoverflow.com/questions/70638118/configuring-compilers-on-mac-m1-big-sur-monterey-for-rcpp-and-other-tools/70664229#70664229
Now, it seems like the package has been successfully installed. However, when I try to load the package using library()
, it doesn't work. The error suggest that the libgfortran.5.dyli
b is not located where R thinks it should be /usr/lib
When I run locate libgfortran.5.dylib
in the terminal, I get the following output:
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libgfortran.5.dylib
/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libgfortran.5.dylib
/opt/R/arm64/gfortran/lib/libgfortran.5.dylib
I have already tried adding a link to the file in the location where R is looking, but I get an "Operation Not Permitted" error, presumably because my Mac doesn't want me to edit the user library directory.
Any ideas for how to fix? Thanks.
library("impute")
# include your problematic code here with any corresponding output
# please also include the results of running the following in an R session
ERROR:
`Error: package or namespace load failed for ‘impute’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/impute/libs/impute.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/impute/libs/impute.so, 0x0006): Library not loaded: @rpath/libgfortran.5.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/impute/libs/impute.so
Reason: tried: '/usr/lib/libgfortran.5.dylib' (no such file)
SESSION INFO:
R version 4.1.2 (2021-11-01)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] BiocManager_1.30.16 compiler_4.1.2 tools_4.1.2 knitr_1.37
[5] xfun_0.29
Same problem here. Loaded from finder and agreed to 'open' for numerous files. Eventually alllowed to load the library.