error Installing topicmodels in R Ubuntu

筅森魡賤 提交于 2019-12-12 08:52:39

问题


I am getting error while installing topicmodels package in R.

on running install.packages("topicmodels",dependencies=TRUE) following are the last few lines I am getting. Please help. My R version is 3.1.3.

g++ -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c utilities.cpp -o utilities.o

gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c utils.c -o utils.o

g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o topicmodels.so cokus.o common.o ctm.o dataset.o gsl-wrappers.o inference.o lda-alpha.o lda-inference.o lda-model.o model.o rGibbslda.o rctm.o rlda.o utilities.o utils.o -lgsl -lgslcblas -L/usr/lib/R/lib -lR

installing to /usr/local/lib/R/site-library/topicmodels/libs

** R

** data

** inst

** preparing package for lazy loading

** help

*** installing help indices

** building package indices

** installing vignettes

** testing if installed package can be loaded

Error in dyn.load(file, DLLpath = DLLpath, ...) : 

  unable to load shared object '/usr/local/lib/R/site-library/topicmodels/libs/topicmodels.so':

  libgsl.so.0: cannot open shared object file: No such file or directory

Error: loading failed

Execution halted

ERROR: loading failed

* removing ‘/usr/local/lib/R/site-library/topicmodels’

Warning message:

In install.packages("http://cran.r-project.org/src/contrib/topicmodels_0.2-1.tar.gz",  :

  installation of package ‘/tmp/RtmpbX6uuH/downloaded_packages/topicmodels_0.2-1.tar.gz’ had non-zero exit status

I have searched for this error at many places but haven't found solution. Please help


回答1:


You don't have GSL installed:

sudo apt-get install gsl-bin libgsl0-dev


来源:https://stackoverflow.com/questions/29025379/error-installing-topicmodels-in-r-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!