我正在尝试将 HMSC R 包安装到 RStudio 版本 1.2.1335 和 R 版本 3.6.1 (2019-07-05) -- Linux Ubuntu 18.04.2 LTS 系统上的“脚趾动作”
通过R安装的代码如下
library(devtools)
install_url('https://cran.r-project.org/src/contrib/Archive/BayesLogit/BayesLogit_0.6.tar.gz')
install_github("hmsc-r/HMSC", build_opts = c("--no-resave-data", "--no-manual"))
安装 BayesLogit_0.6.tar.gz 时出现以下错误
/home/barefootbushman/miniconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lblas
/home/barefootbushman/miniconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -llapack
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'BayesLogit.so' failed
make: *** [BayesLogit.so] Error 1
ERROR: compilation failed for package ‘BayesLogit’
* removing ‘/home/barefootbushman/R/x86_64-pc-linux-gnu-library/3.6/BayesLogit’
Error in i.p(...) :
(converted from warning) installation of package ‘/tmp/RtmpL8qXxH/file18aa17542138/BayesLogit_0.6.tar.gz’ had non-zero exit status
我已经检查了 -lblas 和 -lapack 的安装使用
sudo apt-get update
Hit:1 http://nz.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://nz.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://nz.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 https://repo.skype.com/deb stable InRelease
Hit:5 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
Get:6 https://desktop-download.mendeley.com/download/apt stable InRelease [2,456 B]
Ign:7 http://dl.bintray.com/basespace/BaseMount-DEB saucy InRelease
Ign:8 http://dl.bintray.com/basespace/BaseSpaceFS-DEB saucy InRelease
Hit:9 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:10 http://ppa.launchpad.net/inkscape.dev/stable/ubuntu bionic InRelease
Get:11 http://dl.bintray.com/basespace/BaseMount-DEB saucy Release [1,838 B]
Get:12 http://dl.bintray.com/basespace/BaseSpaceFS-DEB saucy Release [1,837 B]
Hit:13 http://ppa.launchpad.net/marutter/rrutter/ubuntu bionic InRelease
Fetched 6,131 B in 2s (4,067 B/s)
Reading package lists... Done
其次是
sudo apt-get install libblas-dev liblapack-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libblas-dev is already the newest version (3.7.1-4ubuntu1).
liblapack-dev is already the newest version (3.7.1-4ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
但是,尝试在 R 中安装 BayesLogit 时,我仍然遇到相同的错误。
任何有关如何克服此错误的帮助将不胜感激。克里斯
要在所有当前支持的 Ubuntu 版本中安装 HMISC R 包,请打开终端并键入:
r-cran-hmisc 软件包不依赖于 libblas-dev 或 liblapack-dev,因此在尝试安装 r-cran-hmisc 时不会收到错误消息
cannot find -lblas
。cannot find -llapack
您在尝试安装 HMISC R 软件包时收到的错误消息肯定是 Anaconda 的错,但我不知道罪魁祸首 Anaconda 文件在您的系统中的位置。通常当路径被 Anaconda 阻塞时,您可以将其符号链接回适当的 Ubuntu 可执行文件。如果 Anaconda 在您的系统中弄乱了太多路径,那么摆脱混乱的唯一方法就是完全卸载并清除 Anaconda。