macbook m1 R studio install deseq2 dependent package genefilter failed
r studio
BiocManager::install('genefilter')
#result show
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details
replacement repositories:
CRAN: https://mirrors.tuna.tsinghua.edu.cn/CRAN/
Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.0 (2021-05-18)
Installing package(s) 'genefilter'
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘genefilter’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘genefilter’
trying URL 'https://bioconductor.org/packages/3.13/bioc/src/contrib/genefilter_1.74.0.tar.gz'
Content type 'application/x-gzip' length 805682 bytes (786 KB)
==================================================
downloaded 786 KB
* installing *source* package ‘genefilter’ ...
** using staged installation
** libs
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c half_range_mode.cpp -o half_range_mode.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init.c -o init.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c nd.c -o nd.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c pAUC.c -o pAUC.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c rowPAUCs.c -o rowPAUCs.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c rowttests.c -o rowttests.o
/opt/R/arm64/bin/gfortran -mtune=native -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c ttest.f -o ttest.o
make: /opt/R/arm64/bin/gfortran: No such file or directory
make: *** [ttest.o] Error 1
ERROR: compilation failed for package ‘genefilter’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter’
The downloaded source packages are in
‘/private/var/folders/bt/t904ydv902d4lqg2_jxf_n600000gn/T/Rtmpz5VVBy/downloaded_packages’
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'
6: In .inet_warning(msg) :
installation of package ‘genefilter’ had non-zero exit status
the error showed: make: /opt/R/arm64/bin/gfortran: No such file or directory. so I downloaded gfortran in terminal
macbook terminal
neurox@NeuroX ~ % cat ./.bash_profile
export gfortran=/usr/local/gfortran/bin
export PATH=$PATH:$gfortran
neurox@NeuroX ~ % source ./.bash_profile
neurox@NeuroX ~ % gfortran -v
使用内建 specs。
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin15/6.1.0/lto-wrapper
目标:x86_64-apple-darwin15
配置为:../gcc-6.1.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/deps-static/x86_64 --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin15
线程模型:posix
gcc 版本 6.1.0 (GCC)
Also, I add it to the r studio path
Sys.setenv(gfortran="/usr/local/gfortran/bin") then still failed
still get
make: /opt/R/arm64/bin/gfortran: No such file or directory
so i do this
# make link to /opt/R/arm64/bin
sudo ln -s /usr/local//gfortran/bin/gfortran /opt/R/arm64/bin
finally
BiocManager::install('genefilter')
make: /opt/R/arm64/bin/gfortran: Permission denied
upset!!! i need help thanks!
Thanks for sharing! I also have Apple M1 Chip. This solved my problem.
Hi,
Did you manage to get rid of the warning:
I'm on a M1 chip like you and my guess is that bioconductor does not support R M1 installations yet.
I've got R/Bioconductor working on M1.
I'm not sure how you arrived at that error, perhaps consider supplying your code?
Hi Michael,
Sure
Try [n] to updating packages, and "no" to install from source.
[n] stops the installation. I've tried to force since it is installed already and then I tried
none
as you said.Michael,
Do you have perhaps R binary installed for Intel chips ? Mine is arm64.pkg. I read somehwhere the binary for Intel chips works fine and it is emulated by Rosetta. I believe it's just not as fast as the binary which is dedicated for ARM chips.
What happens when you do
If it says something about genefilter, then just try to install genefilter, not DESeq2 again, and report the first error.
Hi Michael,
It does not complain about
genefilter
. I can install Deseq2 just fine from source, the only issue is that I cannot really get rid of the warning message.I raised a question if Bioconductor supports M1 binaries in general and it seems like it does not, at this link :
Warning messages on Apple M1 BigSur
I see, yes I'm not aware of how to get rid of that warning, although I don't see it on my M1 laptop using Bioconductor packages.
Hi Michael, I am on an MAC with M1 and am having similar issues. The error is due to genefilter. Please see error message below and session info. Any advice for dealing with the genefilter issue? Thank you!!
library(DESeq2)
Loading required package: S4Vectors Loading required package: stats4 Loading required package: BiocGenerics
Attaching package: ‘BiocGenerics’
The following objects are masked from ‘package:stats’:
The following objects are masked from ‘package:base’:
Attaching package: ‘S4Vectors’
The following objects are masked from ‘package:base’:
Loading required package: IRanges Loading required package: GenomicRanges Loading required package: GenomeInfoDb Loading required package: SummarizedExperiment Loading required package: MatrixGenerics Loading required package: matrixStats
Attaching package: ‘MatrixGenerics’
The following objects are masked from ‘package:matrixStats’:
Loading required package: Biobase Welcome to Bioconductor
Attaching package: ‘Biobase’
The following object is masked from ‘package:MatrixGenerics’:
The following objects are masked from ‘package:matrixStats’:
Error: package or namespace load failed for ‘DESeq2’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter/libs/genefilter.so': dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter/libs/genefilter.so, 6): no suitable image found. Did find: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter/libs/genefilter.so: mach-o, but wrong architecture /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter/libs/genefilter.so: mach-o, but wrong architecture
R version 4.1.1 (2021-08-10) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Big Sur 11.4
Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRblas.0.dylib 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
I see you have
arm64
in your Library path, see this related thread:Warning messages on Apple M1 BigSur
also: Problem loading R packages on MacBook Pro
Hi Michael, Yes, this is what I thought. I have followed the instructions in the link provided and have downloaded Anaconda. Does Anaconda need to be in a specific place? I am still getting the same error message when I load DESeq2 into R.
/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter/libs/genefilter.so: mach-o, but wrong architecture /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter/libs/genefilter.so: mach-o, but wrong architecture
Do you know of any step-by-step instructions for Using Anaconda with R?
Thank you!
Working through this, do you recommend:
-installing Anaconda, -deleting previous versions of R and R studio and libraries -re installing R from within Anaconda environment, then install DESeq2 through this new version of R.
or
Can you place Anaconda within the existing path for R and Rstudio and run Anaconda through existing R installs?
My preference would be the second option if that is possible? Can you provide some guidance about PATHS for this?
Thanks!
I have an M1 mac, and my installation setup was to go to
https://cran.r-project.org/
click download R for Mac, then R 4.1.2 binary for macOS 10.13 (High Sierra) and higher, Intel 64-bit build, signed and notarized package.
I didn't use Anaconda at all, just installed the version from CRAN directly.
Hi! I can confirm that this solution worked. Specifically, I downloaded the R 4.1.2 binary for macOS 10.13 (High Sierra), Intel 64-bit build, signed and notarized package.
Closed R and Rstudio
Re-openned and checked install worked and reinstalled packages.
Deseq2 now working!! No need for Anaconda.
Yes, this solution worked for me as well.
This error is similar to this one: https://stackoverflow.com/questions/66817276/how-to-install-rcpparmadillo-on-apple-silicon-m1-macs
So if you already have
gfortran
installed like I did, you can just symlink to it: