Error installing 'topicmodels' package, non zero exit status; Ubuntu
Asked Answered
P

2

13

On Ubuntu 14.04, trusty:

install.packages('topicmodels')

Error message:

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**
Polynuclear answered 10/9, 2014 at 6:49 Comment(0)
P
36

I found out that on two of my Ubuntu installations, the non-zero exit status was caused by not having the gsl package. However, it took me quite sometime before I could figure out which version would cure the error.

In the terminal: sudo apt-get install libgsl0-dev

Polynuclear answered 10/9, 2014 at 6:50 Comment(2)
For macOS users experiencing the same issue: brew install gsl solved it for me (macOS 10.14.6)Rosa
In 2020 on Ubuntu 20.04 sudo apt install libgsl-dev solved it for me.Screwball
V
0

In this version of topicmodels, the build script contains the wrong file name:

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
Vicinal answered 16/5, 2017 at 0:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.