【发布时间】:2014-07-21 00:25:09
【问题描述】:
我正在尝试在 OS X 10.9 Mavericks 上安装 R 包 (spdep),其中 R 3.0.1 (sessionInfo 在底部)。该软件包是从http://cran.r-project.org/web/packages/spdep/index.html(源文件spdep_0.5-71.tar.gz)下载的,我尝试使用R CMD INSTALL通过终端安装它。
问题是终端产生这个错误:
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
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.1/Resources/library/spdep’
我尝试重新安装 Xcode 和我已经拥有的命令行工具。我还在终端中安装了gfortran-4.8.2-darwin13.tar.bz2 做sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2
。但它仍然给我同样的错误。
有什么办法吗?
谢谢!
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
【问题讨论】:
-
当将 R 3.1.0 与 Mavericks 一起使用时,该包在 CRAN 的编译也失败。您的会话信息表明您使用的是 R 3.1.0。当 R-Mac-SIG 报告类似问题时,Ripley 教授说 R Admin 文档中有说明。 stat.ethz.ch/pipermail/r-sig-mac/2014-April/010833.html
-
是的,我看过那个文件,我认为它指向 cran.r-project.org/doc/manuals/r-release/R-admin.html#OS-X 和 cran.r-project.org/doc/manuals/r-release/… 。无论如何,我安装了 Ripley 教授提到的 fortran 库,但没有结果。也许我必须更改默认编译器设置,但我不知道如何。