Open s-andrews opened 3 years ago
The install of the R packages on the M1 apparently fails.
The sysname seen by R for these systems is:
> Sys.info()["sysname"]
sysname
"Darwin"
..so it's exactly the same as x86 Macs, and as such R tries (but apparently fails) to install binary packages. On the report we got the owner had installed R through homebrew and that then tried to compile packages, but the compilations all failed in a similar way:
* installing *source* package 'fastmap' ...
** package 'fastmap' successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.0.5_1/lib/R/include" -DNDEBUG -Ilib/ -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -DR_NO_REMAP -fPIC -g -O2 -c fastmap.cpp -o fastmap.o
clang -I"/opt/homebrew/Cellar/r/4.0.5_1/lib/R/include" -DNDEBUG -Ilib/ -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -fPIC -Wno-implicit-function-declaration -c init.c -o init.o
clang++ -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/homebrew/Cellar/r/4.0.5_1/lib/R/lib -L/opt/homebrew/opt/gettext/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/xz/lib -L/opt/homebrew/lib -o fastmap.so fastmap.o init.o -L/opt/homebrew/Cellar/r/4.0.5_1/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
ld: warning: ld: warning: ignoring file /opt/homebrew/opt/gettext/lib/libintl.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64ignoring file /opt/homebrew/Cellar/r/4.0.5_1/lib/R/lib/libR.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Subsequent packages then fail because the first package can't be loaded.
Error: package or namespace load failed for 'fastmap' in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/thusor/Library/R/4.0/library/00LOCK-fastmap/00new/fastmap/libs/fastmap.so':
dlopen(/Users/thusor/Library/R/4.0/library/00LOCK-fastmap/00new/fastmap/libs/fastmap.so, 6): no suitable image found. Did find:
/Users/thusor/Library/R/4.0/library/00LOCK-fastmap/00new/fastmap/libs/fastmap.so: mach-o, but wrong architecture
The original reporter said that they could get this to work by specifically opening a rosetta session and installing homebrew and R in that.
The issues came from the M1 processor and Rosetta 2. SeqMonk can not recognize that this is not an Intel x86-64 processor and it would like to generate the binaries for Intel x86-64. Rosetta 2 can run the Intel x86-64 program if the program run in Rosetta 2. SeqMonk do not use Rosetta 2 and also it can not use Rosetta 2 for R packages. If I run a terminal in Rosetta 2 and install everything from CRAN to SeqMonk, after that SeqMonk can recognize that every R packages are installed. So, I installed homebrew and R in Rosetta 2, after that I installed the R packages which is important for SeqMonk. With this method SeqMonk work very well.
I'm not entirely clear what I can do within SeqMonk to improve this, or whether this is something which will magically fix itself if I wait for improved OSX binary R packages to appear.
AdoptOpenJDK now claim to have native M1 support, but it's not entirely clear whether this is in current releases or just targetted for JDK17.
There is a separate report for getting M1 JDK into homebrew which is still open at time of writing.
We've also had crash reports where R package installation fails for users running M1 macs.
The signature for these crashes is:
SeqMonk Version:1.48.0
Operating System:Mac OS X - 10.16
R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
> install.bioconductor("DESeq2")
Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.0 (2021-05-18) Installing package(s) 'DESeq2'
also installing the dependencies 'Biostrings', 'zlibbioc', 'KEGGREST', 'GenomeInfoDb', 'XVector', 'DelayedArray', 'AnnotationDbi', 'annotate', 'S4Vectors', 'IRanges', 'GenomicRanges', 'SummarizedExperiment', 'Biobase', 'BiocParallel', 'genefilter', 'geneplotter'
Packages which are only available in source form, and may need
compilation of C/C++/Fortran: 'Biostrings' 'zlibbioc' 'XVector'
'DelayedArray' 'S4Vectors' 'IRanges' 'GenomicRanges' 'Biobase'
'BiocParallel' 'genefilter' 'DESeq2'
These will not be installed
According to this post BioConductor doesn't natively support M1 macs, so the fix is to install the Intel version of R which then runs in emulation mode, and for which there are binary packages available.
Another failure signature from R ARM packages. It seems to try to find the folder on bioconductor, which doesn't exist, and everything dies from there:
ERROR: dependency 'Biostrings' is not available for package 'KEGGREST'
* removing '/Users/timothyerickson/Library/R/arm64/4.1/library/KEGGREST'
ERROR: dependencies 'S4Vectors', 'IRanges' are not available for package 'GenomeInfoDb'
* removing '/Users/timothyerickson/Library/R/arm64/4.1/library/GenomeInfoDb'
ERROR: dependencies 'Biobase', 'IRanges', 'S4Vectors', 'KEGGREST' are not available for package 'AnnotationDbi'
* removing '/Users/timothyerickson/Library/R/arm64/4.1/library/AnnotationDbi'
ERROR: dependencies 'GenomicRanges', 'Biobase', 'S4Vectors', 'IRanges', 'GenomeInfoDb', 'DelayedArray' are not available for package 'SummarizedExperiment'
* removing '/Users/timothyerickson/Library/R/arm64/4.1/library/SummarizedExperiment'
ERROR: dependencies 'AnnotationDbi', 'Biobase' are not available for package 'annotate'
* removing '/Users/timothyerickson/Library/R/arm64/4.1/library/annotate'
ERROR: dependencies 'Biobase', 'annotate', 'AnnotationDbi' are not available for package 'geneplotter'
* removing '/Users/timothyerickson/Library/R/arm64/4.1/library/geneplotter'
The downloaded source packages are in
'/private/var/folders/8r/tw5q1mt94ljc5mrv8tyxdvnr0000gn/T/RtmpqgmKCd/downloaded_packages'
There were 11 warnings (use warnings() to see them)
> install.bioconductor("edgeR")
Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.0 (2021-05-18) Installing package(s) 'edgeR'
also installing the dependency 'limma'
Packages which are only available in source form, and may need
compilation of C/C++/Fortran: 'limma' 'edgeR'
These will not be installed
Warning messages:
1: In .inet_warning(msg) :
unable to access index for repository https://bioconductor.org/packages/3.13/bioc/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/bioc/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
2: In .inet_warning(msg) :
unable to access index for repository https://bioconductor.org/packages/3.13/data/annotation/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/data/annotation/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
3: In .inet_warning(msg) :
unable to access index for repository https://bioconductor.org/packages/3.13/data/experiment/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/data/experiment/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
4: In .inet_warning(msg) :
unable to access index for repository https://bioconductor.org/packages/3.13/workflows/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/workflows/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
5: In .inet_warning(msg) :
unable to access index for repository https://bioconductor.org/packages/3.13/books/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/books/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
> install.bioconductor("fastseg")
Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.0 (2021-05-18) Installing package(s) 'fastseg'
also installing the dependencies 'zlibbioc', 'GenomeInfoDb', 'XVector', 'GenomicRanges', 'Biobase', 'S4Vectors', 'IRanges'
Updating this since it's been left a while. For the moment we're fine using the current JDK and with time we'll likely to move to a multi-platform JDK package, or split the ARM and Intel branches.
For R, although CRAN support ARM binary packages, Bioconductor doesn't, so you have to use the Intel version of R to get the packages to install. I've updated the help to explain this, but as and when bioconductor expands their support we can change this.
This is a placeholder issue to track any issues which arise from the recent release of ARM (M1) based Mac systems.
We've had some initial reports back from owners of these systems (I don't have one!). We are currently only shipping an x86 JVM with the SeqMonk DMG file, but it appears that this is successfully run through the Rosetta system so SeqMonk runs OK.
The place where there is a bigger issue is in the installation of the R packages. We've had some reports that the automated installation of these is failing, but also a workround which seems to work.