Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing packages fails

Tags:

installation

r

When trying to install packages like ndl, minqa, RcppEigen, lme4 and others I get the following error:

    install.packages("RcppEigen")
Installing package into ‘/home/matias/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
probando la URL 'http://cran.at.r-project.org/src/contrib/RcppEigen_0.3.2.0.2.tar.gz'
Content type 'application/x-gzip' length 1251504 bytes (1.2 Mb)
URL abierta
==================================================
downloaded 1.2 Mb

* installing *source* package ‘RcppEigen’ ...
** package ‘RcppEigen’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG   -I"/home/matias/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include"  -I../inst/include -fpic  -O3 -pipe  -g  -c RcppEigen.cpp -o RcppEigen.o
g++ -I/usr/share/R/include -DNDEBUG   -I"/home/matias/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include"  -I../inst/include -fpic  -O3 -pipe  -g  -c fastLm.cpp -o fastLm.o
g++ -shared -o RcppEigen.so RcppEigen.o fastLm.o Note: no visible binding for global variable '.Data' Note: no visible binding for global variable '.Data' -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
g++: error: Note:: No existe el archivo o el directorio
g++: error: no: No existe el archivo o el directorio
g++: error: visible: No existe el archivo o el directorio
g++: error: binding: No existe el archivo o el directorio
g++: error: for: No existe el archivo o el directorio
g++: error: global: No existe el archivo o el directorio
g++: error: variable: No existe el archivo o el directorio
g++: error: '.Data': No existe el archivo o el directorio
g++: error: Note:: No existe el archivo o el directorio
g++: error: no: No existe el archivo o el directorio
g++: error: visible: No existe el archivo o el directorio
g++: error: binding: No existe el archivo o el directorio
g++: error: for: No existe el archivo o el directorio
g++: error: global: No existe el archivo o el directorio
g++: error: variable: No existe el archivo o el directorio
g++: error: '.Data': No existe el archivo o el directorio
make: *** [RcppEigen.so] Error 1
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/home/matias/R/x86_64-pc-linux-gnu-library/3.0/RcppEigen’

The downloaded source packages are in
    ‘/tmp/RtmpzLOC7E/downloaded_packages’
Mensajes de aviso perdidos
In install.packages("RcppEigen") :
  installation of package ‘RcppEigen’ had non-zero exit status

I tried reinstalling R with:

 sudo apt-get remove --purge r-base r-base-dev r-base-core
 sudo apt-get install r-base r-base-dev

And I removed everything in the R folder, but the problem persists. What can I try next?

like image 498
Matías Guzmán Naranjo Avatar asked Dec 01 '22 16:12

Matías Guzmán Naranjo


2 Answers

I am far from an R expert, but I had a similar problem installing minqa, and it was due to a welcome message in my ~/.Rprofile file. It turns out that (for reasons unknown to me) whatever directs the C++ compilation of minqa seems to pipe stdout directly to g++, which is the C++ compiler.

You can see this in your error message:

g++: error: Note:: No existe el archivo o el directorio
g++: error: no: No existe el archivo o el directorio
g++: error: visible: No existe el archivo o el directorio
g++: error: binding: No existe el archivo o el directorio
g++: error: for: No existe el archivo o el directorio
g++: error: global: No existe el archivo o el directorio
g++: error: variable: No existe el archivo o el directorio
g++: error: '.Data': No existe el archivo o el directorio

Something is producing the message "Note: no visible binding for global variable '.Data'" which is being passed directly to g++. If you can suppress this warning message somehow, my guess is that minqa will then compile happily.

Edit: I just realized that you solved the problem by re-installing Ubuntu. Oh well.

like image 112
Kevinismus Avatar answered Dec 06 '22 09:12

Kevinismus


That looks extremely fscked up.

Now, I develop/maintain these on Ubuntu, so you have a pretty high chance of getting it to work unless you somehow blow up your system.

Try something simpler first. In R, please do:

 R> library(Rcpp)
 R> evalCpp("2+2")   

Do you get the answer we'd expect? If not, you are not set up for compiling. Install the r-base-dev package as a start.

If everthing else fails, use the prebuild packges which I maintain for lme4, RcppEigen, Rcpp, ...

like image 37
Dirk Eddelbuettel Avatar answered Dec 06 '22 10:12

Dirk Eddelbuettel