1

I'm using a Linux CentOS release 6.6 on my laptop, and I've tried to install the "topicmodels" package into my R environment.

So I used the install.packages("topicmodels") command but unfortunately it did not work.

Here are the log messages that I got:

    * installing *source* package ‘topicmodels’ ...
** package ‘topicmodels’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c cokus.c -o cokus.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c common.c -o common.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c ctm.c -o ctm.o
ctm.c:29:25: error: gsl/gsl_rng.h: No such file or directory
ctm.c:30:28: error: gsl/gsl_vector.h: No such file or directory
ctm.c:31:28: error: gsl/gsl_matrix.h: No such file or directory
In file included from ctm.c:33:
gsl-wrappers.h:32: warning: type defaults to ‘int’ in declaration of ‘gsl_vector’
gsl-wrappers.h:32: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
gsl-wrappers.h:33: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:34: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:35: warning: type defaults to ‘int’ in declaration of ‘gsl_matrix’
gsl-wrappers.h:35: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
gsl-wrappers.h:36: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:37: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:38: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:39: warning: type defaults to ‘int’ in declaration of ‘gsl_vector’
gsl-wrappers.h:39: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
gsl-wrappers.h:40: warning: type defaults to ‘int’ in declaration of ‘gsl_matrix’
gsl-wrappers.h:40: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
gsl-wrappers.h:41: error: expected declaration specifiers or ‘...’ before ‘gsl_vector’
gsl-wrappers.h:42: error: expected declaration specifiers or ‘...’ before ‘gsl_matrix’
gsl-wrappers.h:43: error: expected declaration specifiers or ‘...’ before ‘gsl_vector’
gsl-wrappers.h:44: error: expected declaration specifiers or ‘...’ before ‘gsl_matrix’
gsl-wrappers.h:45: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:46: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:47: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:48: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:49: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:50: warning: type defaults to ‘int’ in declaration of ‘gsl_vector’
gsl-wrappers.h:50: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
gsl-wrappers.h:51: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:52: error: expected ‘)’ before ‘*’ token
gsl-wrappers.h:53: error: expected ‘)’ before ‘*’ token
In file included from ctm.c:34:
ctm.h:40: error: expected specifier-qualifier-list before ‘gsl_matrix’
ctm.h:55: error: expected specifier-qualifier-list before ‘gsl_matrix’
ctm.c: In function ‘new_llna_model’:
ctm.c:45: error: ‘llna_model’ has no member named ‘mu’
ctm.c:45: warning: implicit declaration of function ‘gsl_vector_calloc’
ctm.c:46: error: ‘llna_model’ has no member named ‘cov’
ctm.c:46: warning: implicit declaration of function ‘gsl_matrix_calloc’
ctm.c:47: error: ‘llna_model’ has no member named ‘inv_cov’
ctm.c:48: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c: In function ‘new_llna_ss’:
ctm.c:62: error: ‘llna_ss’ has no member named ‘mu_ss’
ctm.c:63: error: ‘llna_ss’ has no member named ‘cov_ss’
ctm.c:64: error: ‘llna_ss’ has no member named ‘beta_ss’
ctm.c:64: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:65: error: ‘llna_ss’ has no member named ‘ndata’
ctm.c: In function ‘del_llna_ss’:
ctm.c:73: warning: implicit declaration of function ‘gsl_vector_free’
ctm.c:73: error: ‘llna_ss’ has no member named ‘mu_ss’
ctm.c:74: warning: implicit declaration of function ‘gsl_matrix_free’
ctm.c:74: error: ‘llna_ss’ has no member named ‘cov_ss’
ctm.c:75: error: ‘llna_ss’ has no member named ‘beta_ss’
ctm.c: In function ‘reset_llna_ss’:
ctm.c:81: warning: implicit declaration of function ‘gsl_matrix_set_all’
ctm.c:81: error: ‘llna_ss’ has no member named ‘beta_ss’
ctm.c:82: error: ‘llna_ss’ has no member named ‘cov_ss’
ctm.c:83: warning: implicit declaration of function ‘gsl_vector_set_all’
ctm.c:83: error: ‘llna_ss’ has no member named ‘mu_ss’
ctm.c:84: error: ‘llna_ss’ has no member named ‘ndata’
ctm.c: In function ‘write_ss’:
ctm.c:90: error: ‘llna_ss’ has no member named ‘cov_ss’
ctm.c:90: error: too many arguments to function ‘printf_matrix’
ctm.c:91: error: ‘llna_ss’ has no member named ‘beta_ss’
ctm.c:91: error: too many arguments to function ‘printf_matrix’
ctm.c:92: error: ‘llna_ss’ has no member named ‘mu_ss’
ctm.c:92: error: too many arguments to function ‘printf_vector’
ctm.c: In function ‘corpus_init’:
ctm.c:103: error: ‘gsl_rng’ undeclared (first use in this function)
ctm.c:103: error: (Each undeclared identifier is reported only once
ctm.c:103: error: for each function it appears in.)
ctm.c:103: error: ‘r’ undeclared (first use in this function)
ctm.c:103: warning: implicit declaration of function ‘gsl_rng_alloc’
ctm.c:103: error: ‘gsl_rng_taus’ undeclared (first use in this function)
ctm.c:108: warning: implicit declaration of function ‘gsl_rng_set’
ctm.c:113: warning: implicit declaration of function ‘vset’
ctm.c:113: error: ‘llna_model’ has no member named ‘mu’
ctm.c:114: warning: implicit declaration of function ‘mset’
ctm.c:114: error: ‘llna_model’ has no member named ‘cov’
ctm.c:116: warning: implicit declaration of function ‘matrix_inverse’
ctm.c:116: error: ‘llna_model’ has no member named ‘cov’
ctm.c:116: error: ‘llna_model’ has no member named ‘inv_cov’
ctm.c:117: error: ‘llna_model’ has no member named ‘log_det_inv_cov’
ctm.c:117: warning: implicit declaration of function ‘log_det’
ctm.c:117: error: ‘llna_model’ has no member named ‘inv_cov’
ctm.c:126: warning: implicit declaration of function ‘gsl_rng_uniform’
ctm.c:131: warning: implicit declaration of function ‘minc’
ctm.c:131: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:135: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:137: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:139: warning: implicit declaration of function ‘mget’
ctm.c:139: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:143: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:145: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:146: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:149: warning: implicit declaration of function ‘gsl_rng_free’
ctm.c: In function ‘random_init’:
ctm.c:164: error: ‘gsl_rng’ undeclared (first use in this function)
ctm.c:164: error: ‘r’ undeclared (first use in this function)
ctm.c:164: error: ‘gsl_rng_taus’ undeclared (first use in this function)
ctm.c:170: error: ‘llna_model’ has no member named ‘mu’
ctm.c:171: error: ‘llna_model’ has no member named ‘cov’
ctm.c:180: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:183: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:183: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:185: error: ‘llna_model’ has no member named ‘cov’
ctm.c:185: error: ‘llna_model’ has no member named ‘inv_cov’
ctm.c:186: error: ‘llna_model’ has no member named ‘log_det_inv_cov’
ctm.c:186: error: ‘llna_model’ has no member named ‘inv_cov’
ctm.c: In function ‘write_llna_model’:
ctm.c:207: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:212: error: ‘llna_model’ has no member named ‘mu’
ctm.c:212: error: too many arguments to function ‘printf_vector’
ctm.c:214: error: ‘llna_model’ has no member named ‘cov’
ctm.c:214: error: too many arguments to function ‘printf_matrix’
ctm.c:216: error: ‘llna_model’ has no member named ‘inv_cov’
ctm.c:216: error: too many arguments to function ‘printf_matrix’
ctm.c:219: error: ‘llna_model’ has no member named ‘log_det_inv_cov’
ctm.c:224: error: ‘llna_model’ has no member named ‘log_beta’
ctm.c:224: error: too many arguments to function ‘printf_matrix’
make: *** [ctm.o] Error 1
ERROR: compilation failed for package ‘topicmodels’
* removing ‘/usr/lib64/R/library/topicmodels’

The downloaded source packages are in
    ‘/tmp/RtmpnduiXI/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:

In install.packages("topicmodels") : installation of package ‘topicmodels’ had non-zero exit status

Here are the details of my R version:

platform x86_64-redhat-linux-gnu arch x86_64
os linux-gnu system x86_64, linux-gnu status major 3 minor 1.2
year 2014 month 10
day 31 svn rev 66913
language R version.string R version 3.1.2 (2014-10-31) nickname Pumpkin Helmet

Do you have any idea about why I'm not able to install this package in R? Could you give me some suggestions on fixing this?

2

You need to install at least gsl-devel, which contains the GNU Scientific Library. That should fix the

ctm.c:29:25: error: gsl/gsl_rng.h: No such file or directory
ctm.c:30:28: error: gsl/gsl_vector.h: No such file or directory
ctm.c:31:28: error: gsl/gsl_matrix.h: No such file or directory

errors.

| improve this answer | |
  • Thanks! Yes, that was the problem. I solved by running sudo yum install gsl-devel in the shell terminal. Then I re-ran install.packages("topicmodels") on R and everything worked alright! – DavideChicco.it Feb 10 '15 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.