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
How to Kill All Linux Processes That Are Older Than a Certain Age
How to Run a Windows Executable from Wsl (Ubuntu) Bash
Maximum Number of Concurrent Connections on a Single Port (Socket) of Server
Creating Executable Files in Linux
Getting CPU Cycles Using Rdtsc - Why Does the Value of Rdtsc Always Increase
Joining Multiple Fields in Text Files on Unix
How to Determine If a Detached Pthread Is Alive
Search and Replace with Sed When Dots and Underscores Are Present
Using Ls to List Directories and Their Total Sizes
How to Exclude Directories from Grep -R
How to Remove All .Svn Directories from My Application Directories
Repeat Command Automatically in Linux
How to Append One File to Another in Linux from the Shell