Andrew Kirk Andrew Kirk - 18 days ago 5x
R Question

R fails to install packages, at load stage, under linuxmint (Ubuntu)

I am trying to install package 'RcppEigen' to my installation of R version 3.3.1 on my 64-bit Intel PC running LinuxMint 17.1, which I understand is essentially the same as Ubuntu trusty, as far as R is concerned. The installation always fails at the 'load' stage. I get the same errors when I try to install package 'lme4', which is the package I actually want. RcppEigen is a dependency, on which the lme4 installation fails.

The error messages say it cannot find packages 'lapack' and 'blas'. I've done some searching and found some threads that say I should either set up some symbolic links to the missing files, or copy them somewhere, but it's not clear to me which files those are, other than that they probably have 'lapack' and 'blas' somewhere in their names.

Here is the command I issued, from the R command line.


And here is the output, with error messages.:

Installing package into ‘/home/andrew/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
trying URL ''
Content type 'unknown' length 1209128 bytes (1.2 MB)
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/andrew/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I../inst/include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c RcppEigen.cpp -o RcppEigen.o
g++ -I/usr/share/R/include -DNDEBUG -I"/home/andrew/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I../inst/include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -I/usr/share/R/include -DNDEBUG -I"/home/andrew/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I../inst/include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c fastLm.cpp -o fastLm.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RcppEigen.o RcppExports.o fastLm.o -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR


/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
make: *** [] Error 1
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/home/andrew/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen’
Warning in install.packages :
installation of package ‘RcppEigen’ had non-zero exit status

The downloaded source packages are in

I would be very grateful for any suggestions anybody can make about how to make this installation work.

Thank you

Here is my system info

platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
major 3
minor 3.1
year 2016
month 06
day 21
svn rev 70800
language R
version.string R version 3.3.1 (2016-06-21)
nickname Bug in Your Hair



  1. You can install RcppEigen as a binary: sudo apt-get install r-cran-rcppeigen. There are several hundred core CRAN packages ...

  2. The error messages cannot find -llapack and cannot find -lblas indicate that you have the run-time environment but the development headers / packages. Easiest fix: do sudo install r-base-dev and try again.

Either approach should work. If all else fails consider coming to the r-sig-debian list for help with R on Debian-based systems.