Macbook M1 install genefilter failed
2
0
Entering edit mode
soda ▴ 80
@5b9023e7
Last seen 18 months ago
China

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!

DESeq2 m1 macbook genefilter • 14k views
ADD COMMENT
0
Entering edit mode

Hi soda, I've met the same problem with you. I fail to install the "genefilter" package with my M1 MacBook arm64 Studio I've tried several ways I could find to solve this problem, including root or modify the "/.config/Rstudio" file, and it still showed make: /opt/R/arm64/bin/gfortran: Permission denied Since you had solved this problem by yourself (download gfortran in path /opt/R/arm64/bin), I did as the instructions. However, I could not download it in the correct path (it would be downloaded in "/User/id" instead of "/opt/R/arm64/bin") and could not open it with sudo tar fvxz even in the su root I really hope you can help me with this.

Best regards Zhusheng Zhang

ADD REPLY
0
Entering edit mode

Hello Zhusheng Zhang, Except this problem, R arm64 has many other bugs.So I unload R arm64 ,then download 'Intel 64-bit build' version. Now, I have never encountered any problems about installing package. The following answer is the same as mine,you can read it.

ADD REPLY
8
Entering edit mode
soda ▴ 80
@5b9023e7
Last seen 18 months ago
China

i have solved this problem by myself. share with you. you need to download gfortran in path /opt/R/arm64/bin this website helped me: https://mac.r-project.org/libs-arm64/ ''' curl -O http://mac.R-project.org/libs-arm64/https://mac.r-project.org/libs-arm64/gfortran-f51f1da0-darwin20.0-arm64.tar.gz sudo tar fvxz https://mac.r-project.org/libs-arm64/gfortran-f51f1da0-darwin20.0-arm64.tar.gz -C / '''

ok

i succeed

ADD COMMENT
0
Entering edit mode

Thanks for sharing! I also have Apple M1 Chip. This solved my problem.

ADD REPLY
0
Entering edit mode

Hi,

Did you manage to get rid of the warning:

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'

I'm on a M1 chip like you and my guess is that bioconductor does not support R M1 installations yet.

ADD REPLY
0
Entering edit mode

I've got R/Bioconductor working on M1.

I'm not sure how you arrived at that error, perhaps consider supplying your code?

ADD REPLY
0
Entering edit mode

Hi Michael,

Sure

> BiocManager::install("DESeq2")
'getOption("repos")' replaces Bioconductor standard repositories,
see '?repositories' for details

replacement repositories:
    CRAN: http://cran.rstudio.com/

Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.1
  (2021-08-10)
Old packages: 'rmarkdown', 'xfun'
Update all/some/none? [a/s/n]: 
a
also installing the dependency ‘jquerylib’

Warning: 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'
Warning: 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'
Warning: 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'
Warning: 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'
Warning: 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'

  There are binary versions available but the source
  versions are later:
          binary source needs_compilation
rmarkdown   2.10   2.11             FALSE
xfun        0.25   0.26              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) 
ADD REPLY
0
Entering edit mode

Try [n] to updating packages, and "no" to install from source.

ADD REPLY
0
Entering edit mode

[n] stops the installation. I've tried to force since it is installed already and then I tried none as you said.

> BiocManager::install("DESeq2",force = T)
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details

replacement repositories:
    CRAN: http://cran.rstudio.com/

Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.1 (2021-08-10)
Installing package(s) 'DESeq2'
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘DESeq2’
Do you want to attempt to install these from sources? (Yes/no/cancel) no
Old packages: 'RCurl', 'rmarkdown', 'xfun', 'XML'
Update all/some/none? [a/s/n]: 
n
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'
ADD REPLY
0
Entering edit mode

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. enter image description here

ADD REPLY
0
Entering edit mode

What happens when you do

library(DESeq2)

If it says something about genefilter, then just try to install genefilter, not DESeq2 again, and report the first error.

ADD REPLY
0
Entering edit mode

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.

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'

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

ADD REPLY
1
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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’:

IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

anyDuplicated, append, as.data.frame, basename, cbind, colnames,
dirname, do.call, duplicated, eval, evalq, Filter, Find, get,
grep, grepl, intersect, is.unsorted, lapply, Map, mapply, match,
mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position,
rank, rbind, Reduce, rownames, sapply, setdiff, sort, table,
tapply, union, unique, unsplit, which.max, which.min

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

expand.grid, I, unname

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’:

colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
colWeightedMeans, colWeightedMedians, colWeightedSds,
colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
rowWeightedSds, rowWeightedVars

Loading required package: Biobase Welcome to Bioconductor

Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.

Attaching package: ‘Biobase’

The following object is masked from ‘package:MatrixGenerics’:

rowMedians

The following objects are masked from ‘package:matrixStats’:

anyMissing, rowMedians

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

sessionInfo()

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

ADD REPLY
0
Entering edit mode

I see you have arm64 in your Library path, see this related thread:

Warning messages on Apple M1 BigSur

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

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!

ADD REPLY
0
Entering edit mode

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!

ADD REPLY
1
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Yes, this solution worked for me as well.

ADD REPLY
0
Entering edit mode

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:

ln -s /usr/local/gfortran/bin/gfortran /opt/R/arm64/bin
ADD REPLY
0
Entering edit mode
@herve-pages-1542
Last seen 14 hours ago
Seattle, WA, United States

See "problems about installation of package ‘Rhtslib’, ‘Rsamtools’ ,‘GenomicAlignments’ , ‘ShortRead’ on macOS Big Sur using R 4.1.0" for more information about how to install Bioconductor on M1 mac.

ADD COMMENT

Login before adding your answer.

Traffic: 775 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6