更新软件包igraph和spdep时出现问题

时间:2019-02-14 18:54:49

标签: r igraph spdep

我正在尝试安装NormqPCR软件包,我必须更新两个软件包,即igraph和spdep,但是直到现在我还是不能弄清楚我该怎么做。 这是代码。

if (!requireNamespace("BiocManager", quietly = TRUE))
+     install.packages("BiocManager")
> BiocManager::install("NormqPCR", version = "3.8")
Bioconductor version 3.8 (BiocManager 1.30.4), R 3.5.2 (2018-12-20)
Installing package(s) 'NormqPCR'
trying URL 'https://bioconductor.org/packages/3.8/bioc/bin/macosx/el-capitan/contrib/3.5/NormqPCR_1.28.0.tgz'
Content type 'application/x-gzip' length 425843 bytes (415 KB)
==================================================
downloaded 415 KB


The downloaded binary packages are in
    /var/folders/1d/n28vx45163z4ksd8pcqxjwzh0000gn/T//Rtmpb5GHtX/downloaded_packages
Update old packages: 'BiocInstaller', 'igraph', 'spdep'
Update all/some/none? [a/s/n]: 
a

  There are binary versions available but the source versions are later:
       binary source needs_compilation
igraph  1.2.3  1.2.4              TRUE
spdep   0.8-1  1.0-2              TRUE

Do you want to install from sources the packages which need compilation? (Yes/no/cancel) Yes
trying URL 'https://bioconductor.org/packages/3.8/bioc/bin/macosx/el-capitan/contrib/3.5/BiocInstaller_1.32.1.tgz'

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [spdep.so] Error 1
ERROR: compilation failed for package ‘spdep’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/spdep’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/spdep’

The downloaded source packages are in
    ‘/private/var/folders/1d/n28vx45163z4ksd8pcqxjwzh0000gn/T/Rtmpb5GHtX/downloaded_packages’
Warning messages:
1: In install.packages(update[instlib == l, "Package"], l, repos = repos,  :
  installation of package ‘igraph’ had non-zero exit status
2: In install.packages(update[instlib == l, "Package"], l, repos = repos,  :
  installation of package ‘spdep’ had non-zero exit status
> 

有人知道可行的解决方案吗? 谢谢!

2 个答案:

答案 0 :(得分:0)

在更新到R 3.5之后,我今天也遇到了这个问题。

看起来像一个解决方案是here

基本上,它会安装gfortran 6.3.0,并在〜/ .R / Makevars文件中设置环境变量。

我还没有真正使用它,但是现在可以正常加载了。对我来说,这只是“依赖”,我什至不能100%确定我将要使用的任何东西

答案 1 :(得分:0)

非常感谢Walter。恰如该页面中所述,我在编译时遇到了问题!现在,它可以工作了。