使用Apple M1芯片从源代码安装特定的R软件包导致存储库索引或-lquadmath错误

使用Apple M1芯片从源代码安装特定的R软件包导致存储库索引或-lquadmath错误,r,bioconductor,apple-m1,R,Bioconductor,Apple M1,我知道这已经被问死了,但我在我的M1 MacBook Air上用R编译软件包时遇到了麻烦。我需要DESeq2,它需要RcppArmadillo和genefilter。我下载了一个旧的RccpArmadillo二进制文件,但genefilter似乎没有。我已经广泛地编辑了我的~/.R/Makevars文件,在RStudio上它抛出了一个与lquadmath相关的错误,但在控制台中它没有。我将发布这两个错误。我的~/.R/Makevars文件如下: CC = /Applications/Xcode.

我知道这已经被问死了,但我在我的M1 MacBook Air上用R编译软件包时遇到了麻烦。我需要DESeq2,它需要RcppArmadillo和genefilter。我下载了一个旧的RccpArmadillo二进制文件,但genefilter似乎没有。我已经广泛地编辑了我的
~/.R/Makevars
文件,在RStudio上它抛出了一个与lquadmath相关的错误,但在控制台中它没有。我将发布这两个错误。我的
~/.R/Makevars
文件如下:

CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CXX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CXX11 = $CXX
CXX14 = $CXX
CXX17 = $CXX
CXX20 = $CXX
CFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration
CXXFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXX11FLAGS = $CXXFLAGS
CXX14FLAGS = $CXXFLAGS
CXX17FLAGS = $CXXFLAGS
CXX20FLAGS = $CXXFLAGS
FC = /usr/local/gfortran/bin/gfortran
FLIBS = -L/usr/local/gfortran/lib/gcc/aarch64-apple-darwin20.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
尝试在控制台中安装时遇到的错误是存储库索引错误,大多数人认为这是由于internet连接问题,但我连接到internet,可以下载其他(二进制和源代码)软件包而不会出现问题。这是一个错误:

> BiocManager::install("genefilter")
Bioconductor version 3.13 (BiocManager 1.30.15), 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

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -c half_range_mode.cpp -o half_range_mode.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c init.c -o init.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c nd.c -o nd.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c pAUC.c -o pAUC.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c rowPAUCs.c -o rowPAUCs.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c rowttests.c -o rowttests.o
/usr/local/gfortran/bin/gfortran -fno-optimize-sibling-calls  -fPIC  -Wall -g -O2  -c ttest.f -o ttest.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o genefilter.so half_range_mode.o init.o nd.o pAUC.o rowPAUCs.o rowttests.o ttest.o -L/usr/local/gfortran/lib/gcc/aarch64-apple-darwin20.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

The downloaded source packages are in
    ‘/private/var/folders/tl/40wd6m_91rldyqsnkwqqfdg40000gn/T/RtmpqhSbBH/downloaded_packages’
Old packages: 'RcppArmadillo'
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'
6: In .inet_warning(msg) :
  installation of package ‘genefilter’ had non-zero exit status
最后,当我尝试在RStudio中安装时,会出现以下错误:

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

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

Bioconductor version 3.13 (BiocManager 1.30.15), 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
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -c half_range_mode.cpp -o half_range_mode.o
half_range_mode.cpp:21:11: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
  N = end - start;
    ~ ~~~~^~~~~~~
half_range_mode.cpp:89:30: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    N_double_prime = new_end - new_start;
                   ~ ~~~~~~~~^~~~~~~~~~~
2 warnings generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c init.c -o init.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c nd.c -o nd.o
nd.c:245:5: warning: implicit conversion turns floating-point number into integer: 'double' to '_Bool' [-Wfloat-conversion]
        if(x[i1] || x[i2]){
           ^~~~~ ~~
nd.c:245:14: warning: implicit conversion turns floating-point number into integer: 'double' to '_Bool' [-Wfloat-conversion]
        if(x[i1] || x[i2]){
                 ~~ ^~~~~
nd.c:246:7: warning: implicit conversion turns floating-point number into integer: 'double' to 'RSInt' (aka 'int') [-Wfloat-conversion]
          ct += wval[j];
          ~~~^~~~~~~~~~
nd.c:247:10: warning: implicit conversion turns floating-point number into integer: 'double' to '_Bool' [-Wfloat-conversion]
          if( !(x[i1] && x[i2]) ) ans += wval[j];
                ^~~~~ ~~
nd.c:247:19: warning: implicit conversion turns floating-point number into integer: 'double' to '_Bool' [-Wfloat-conversion]
          if( !(x[i1] && x[i2]) ) ans += wval[j];
                      ~~ ^~~~~
nd.c:247:32: warning: implicit conversion turns floating-point number into integer: 'double' to 'RSInt' (aka 'int') [-Wfloat-conversion]
          if( !(x[i1] && x[i2]) ) ans += wval[j];
                                  ~~~~^~~~~~~~~~
6 warnings generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c pAUC.c -o pAUC.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c rowPAUCs.c -o rowPAUCs.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-implicit-function-declaration -c rowttests.c -o rowttests.o
rowttests.c:45:28: warning: implicit conversion turns floating-point number into integer: 'double' to 'int' [-Wfloat-conversion]
            n[grp][i] = s[grp][i] = ss[grp][i] = 0;
                      ~ ~~~~~~~~~~^~~~~~~~~~~~~~~~
1 warning generated.
/usr/local/gfortran/bin/gfortran -fno-optimize-sibling-calls  -fPIC  -Wall -g -O2  -c ttest.f -o ttest.o
ttest.f:47:12:

   47 |          dm=dm1-dm2
      |            1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
ttest.f:50:12:

   50 |          dm=dm1/dm2
      |            1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
ttest.f:59:13:

   59 |          tst=(dm1-dm2)/sqrt((1.d0/ng1+1.d0/ng2)*(dss1+dss2)/(ng1+ng2-2))
      |             1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
ttest.f:62:10:

   62 |       tst=(dm1-dm2)/sqrt(dss1/((ng1-1)*ng1)+dss2/((ng2-1)*ng2))
      |          1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o genefilter.so half_range_mode.o init.o nd.o pAUC.o rowPAUCs.o rowttests.o ttest.o -L/usr/local/gfortran/lib/gcc/aarch64-apple-darwin20.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: library not found for -lquadmath
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [genefilter.so] Error 1
ERROR: compilation failed for package ‘genefilter’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/genefilter’

The downloaded source packages are in
    ‘/private/var/folders/tl/40wd6m_91rldyqsnkwqqfdg40000gn/T/RtmpIiaMQO/downloaded_packages’
Old packages: 'RcppArmadillo'
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'
6: In .inet_warning(msg) :
  installation of package ‘genefilter’ had non-zero exit status
除了URL错误之外,我还得到了
ld:library not found for-lquadmath clang:error:linker命令失败,退出代码为1(使用-v查看调用)
error(尽管据我所知,我在
~/.R/Makevars
文件中正确地指向了gfortran和gcc)


我做错了什么?为什么我可以毫无问题地下载其他软件包(我安装了GOSeq,它也有需要编译的依赖项),但这一个没有问题?我已经为此工作了好几个小时,如果有任何见解,我将不胜感激。谢谢

您是否尝试过使用gcc进行编译,即将CC和CXX行更改为
CC=/usr/local/gfortran/bin/gcc
CXX=/usr/local/gfortran/bin/g++
?我刚刚尝试过,但不幸的是,得到了相同的错误,因为一个潜在的解决方法可能是通过bioconda安装genefilter包,例如,
conda安装bioconductor genefilter
然后再次尝试通过R安装DESeq2。您也可以尝试Bioconductor的“devel”分支,例如
BioManager::install(version='devel');BioManager::安装(“基因过滤器”)
哦,天哪,我真的以为康达会工作!!我成功地安装了该软件包,但当我尝试将其加载到R时,出现以下错误:
>库(genefilter,lib.loc=“/Users/lindseyschwartz/miniconda3/pkgs/bioconductor-genefilter-1.56.0-r3.3.1_0/lib/R/library”)错误:“genefilter”的包或命名空间加载失败:包“genefilter”是在R 4.0.0之前安装的:请重新安装它
更新该注释:该问题是因为conda安装的版本是旧版本,但当我强制安装最新版本时,我得到如下gfortran错误:
unsatifiableerror:发现以下规范彼此不兼容:格式输出:请求的包->可用版本包libcxx冲突:python=3.9->libffi[version='>=3.3,=4.0.1']python=3.9->libcxx[version='>=10.0.0']bioconductor genefilter=1.72.1->libcxx[version='>=11.1.0']