安装mclustř包(Installing mclust R package)

2019-10-19 02:40发布

我在安装mclust成R,渐渐发现下面的消息,任何想法的一些问题?

install.packages("mclust")


Installing package into ‘/home/aleferna/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://www.laqee.unal.edu.co/CRAN/src/contrib/mclust_4.2.tar.gz'
Content type 'application/x-gzip' length 1602272 bytes (1.5 Mb)
opened URL
==================================================
downloaded 1.5 Mb

* installing *source* package ‘mclust’ ...
** package ‘mclust’ successfully unpacked and MD5 sums checked
** libs
gfortran   -fpic  -O3 -pipe  -g  -c mclust.f -o mclust.o
gcc -std=gnu99 -shared -o mclust.so mclust.o -llapack -lblas -lgfortran -lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
make: *** [mclust.so] Error 1
ERROR: compilation failed for package ‘mclust’
* removing ‘/home/aleferna/R/x86_64-pc-linux-gnu-library/3.0/mclust’

The downloaded source packages are in
    ‘/tmp/RtmpOPyKmZ/downloaded_packages’
Warning message:
In install.packages("mclust") :
  installation of package ‘mclust’ had non-zero exit status

Answer 1:

/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas

意味着你需要安装这样的库,是这样的:

$ sudo apt-get install liblapack-dev libblas-dev

或类似的东西(取决于您的GNU / Linux发行版)。



文章来源: Installing mclust R package
标签: linux r