安装'topicmodels'包时出现错误,非零退出状态;Ubuntu

12

在Ubuntu 14.04(Trusty)上:

install.packages('topicmodels')

错误信息:

compilation terminated.
make: *** [ctm.o] Error 1
ERROR: compilation failed for package ‘topicmodels’
* removing ‘/home/.../R/x86_64-pc-linux-gnu-library/3.1/topicmodels’

The downloaded source packages are in
    ‘/tmp/Rtmp1L79dj/downloaded_packages’
Warning message:
In install.packages("topicmodels") :
  installation of package ‘topicmodels’ had **non-zero exit status**
2个回答

36

我发现在我的两个Ubuntu安装版本上,非零的退出状态是由于没有安装包导致的。然而,在我弄清楚可以解决错误的哪个版本之前,花费了相当长的一段时间。

在终端中输入:sudo apt-get install libgsl0-dev


1
对于使用 macOS 的用户遇到相同问题:brew install gsl 解决了我的问题(macOS 10.14.6)。 - iNyar
1
在2020年的Ubuntu 20.04上,通过执行sudo apt install libgsl-dev命令解决了我的问题。 - Till

0
在这个版本的topicmodels中,构建脚本包含了错误的文件名:
install.packages("topicmodels")
Installing package into ‘/home/ga/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/topicmodels_0.2-6.tar.gz'
...
g++ -std=c++11 -shared -L/usr/lib/R/lib -L/usr/lib/x86_64-linux-gnu -lgsl -lglscblas -o topicmodels.so cokus.o common.o ctm.o dataset.o gsl-wrappers.o inference.o init.o lda-alpha.o lda-inference.o lda-model.o model.o rGibbslda.o rctm.o rlda.o utilities.o utils.o -L/usr/lib/x86_64-linux-gnu -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lglscblas

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接