I have a MacBook Pro with an M1 chip. I have updated to the latest version of bioconductor (v3.15), however I am unable to install bioconductor packages due to compilation errors.
As the documentation says this version is built/requires R v4.2, as such I updated and my current R set-up is:
R version 4.2.0 (2022-04-22)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.3.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-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] compiler_4.2.0 tools_4.2.0
However, when I then tried to install bioconductor packages I ran into a number of compiler errors.
To overcome I first updated my gcc/gfortran via homebrew to the following:
gcc --version
\Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
gfortran --version
GNU Fortran (Homebrew GCC 11.3.0) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
However I still get the compiler issues, specifically due to the location of gcc/gfortran. I installed gfortran via homebrew.
I have read this post here and tried to adapt the line sudo ln -sfn $(xcrun --show-sdk-path) /opt/R/arm64/gfortran/SDK
so that it points to my homebrew installation of gfortran /opt/homebrew/bin/gfortran
I have also tried the method suggested here but still run into the same compilation errors.
If anyone has any suggestions or has run into a similar issue, any advice would be much appreciated!
What is the error message you get when installing a bioconductor package? It may not help but sometimes just reloading your R session after updating your R version solve the problem
The relevant part of the error message is below, and I get this for any bioconductor package I've try to install. I have restarted R each time I've updated the command line relating to gcc/gofortran etc and after updating R and bioconductor.
One strategy is to continue to use the Intel version of R and run it using Rosetta. You can then use the binary packages provided by Bioconductor, so you don't need to compile anything. From what I've read there's almost no performance difference between running the native M1 version compared to the Intel version, but it might save you a lot of headaches getting stuff like this set up.