【问题标题】:R: cannot install 'rasclass' package on Ubuntu 14.04R:无法在 Ubuntu 14.04 上安装“rasclass”包
【发布时间】:2023-03-20 22:09:01
【问题描述】:

我正在尝试在 R(版本 3.2.3)上安装“rasclass”包,但不知何故安装总是失败。输出太大,这里无法粘贴,但是我发现了对this question感兴趣的东西,这可能是解决这个问题的关键。

很快:从终端我可以看到我有 gcc-4.8 和 4.9、g++-4.8 和 4.9 以及 gfortran-4.8。我记得更改 gcc 和 g++ 之间的符号链接以使用“4.9”版本。没有 gfortran-4.9 会不会有问题?如果是这样,下载后如何将符号链接更改为该版本?

最后,我只是粘贴了(失败的)软件包安装的最后一部分。

/usr/bin/ld: impossibile trovare -lgfortran
collect2: error: ld returned 1 exit status
make: *** [RcppEigen.so] Errore 1
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/RcppEigen’
* installing *source* package ‘MatrixModels’ ...
** package ‘MatrixModels’ successfully unpacked and MD5 sums checked
** R
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘Matrix’ 1.1-4 is being loaded, but >= 1.1.5 is required
ERROR: lazy loading failed for package ‘MatrixModels’
* removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/MatrixModels’
ERROR: dependencies ‘minqa’, ‘RcppEigen’ are not available for package ‘lme4’
* removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/lme4’
ERROR: dependencies ‘SparseM’, ‘MatrixModels’ are not available for package ‘quantreg’
* removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/quantreg’
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/pbkrtest’
ERROR: dependencies ‘pbkrtest’, ‘quantreg’ are not available for package ‘car’
* removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/car’
ERROR: dependencies ‘car’, ‘randomForest’ are not available for package ‘rasclass’
* removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/rasclass’

The downloaded source packages are in
    ‘/tmp/RtmphSiL6j/downloaded_packages’
There were 11 warnings (use warnings() to see them)

【问题讨论】:

    标签: r linux gcc g++ gfortran


    【解决方案1】:

    我尝试安装这个包,最后,我成功安装了rasclass库,第二次尝试分别安装了库carpbkrtest

    我的配置:Ubuntu 14.04 LTS - R 3.2.1 RC - gcc 4.8.4

    【讨论】:

    • 我试图安装'car'包,但我仍然收到错误,最后它没有安装。部分错误(仅针对 'minqa' 依赖项,也针对其他依赖项)如下所示: /usr/bin/ld: impossibile trovare -lgfortran collect2: error: ld returned 1 exit status make: *** [minqa .so] Errore 1 错误:包'minqa'的编译失败 *删除'/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/minqa' install.packages中的警告:安装包'minqa'退出状态非零
    【解决方案2】:

    确实,这是 gfortran 的问题。

    我通过sudo apt-get install gfortran-4.9 安装了4.9 版,尝试重新安装rasclass 包及其所有依赖项,现在它可以工作了。正如this question 的评论中所述,我确实弄乱了g++gcc 的符号链接,以使用4.9 版本,但我没有相同版本的gfortran。这似乎是解决问题的关键。

    最后,为了选择gccg++ 版本,我选择了this answer。希望这可以帮助任何人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-02
      • 2015-09-23
      • 2016-03-24
      • 2016-02-16
      相关资源
      最近更新 更多