/Usr/Bin/Ld: Cannot Find -Llapack

R - cannot find -llapack & cannot find -lblas

Many R packages need underlying DLLs (shared objects) that are specific for compiling against, and they often have a -dev suffix on the package name. On my 16.04 Ubuntu system, I see:

$ apt list --installed | egrep 'lapack|blas'

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libblas-common/xenial,now 3.6.0-2ubuntu2 amd64 [installed,automatic]
libblas-dev/xenial,now 3.6.0-2ubuntu2 amd64 [installed,automatic]
libblas3/xenial,now 3.6.0-2ubuntu2 amd64 [installed,automatic]
liblapack-dev/xenial,now 3.6.0-2ubuntu2 amd64 [installed,automatic]
liblapack3/xenial,now 3.6.0-2ubuntu2 amd64 [installed,automatic]

(I also often cheat and look at:

$ ll /var/lib/dpkg/info/*lapack*.list
-rw-r--r-- 1 root root 318 Apr 27 2017 /var/lib/dpkg/info/liblapack3.list
-rw-r--r-- 1 root root 288 Apr 27 2017 /var/lib/dpkg/info/liblapack-dev.list

and while not fast or as flexible a way of looking, it quickly lets me look at the file-listings (these files) or the pre/post-install scripts, if present. Just a hack.)

If you don't have the two -dev packages, you can installed either or both with:

apt-get install libblas-dev liblapack-dev

c++ program compile with LAPACK library

It sounds like your system isn't set up to search /usr/local/lib for libraries.

You can add -L/usr/local/lib to your compile command.

If you need to install the library, I suggest you use this command:

sudo apt-get install liblapack-dev

/usr/bin/ld: cannot find -lc++

Replace clang by clang++ or g++. Then -lc++ becomes "automagically" linked.

Of course, spend a few days reading the documentation of GCC and of Clang (and of ld from binutils; since both clang++ and g++ are running ld). Read carefully about invoking GCC. The order of program arguments to g++ (and also to clang++) are important.

Since you use GNU make, you obviously need to spend a day reading its documentation.

PS. Budget perhaps a week of work in reading documentation.



Related Topics



Leave a reply



Submit