Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"/usr/bin/ld: cannot find -lopenblas" error in Caffe compilation

Tags:

caffe

openblas

When I was compiling Caffe, I had this error, despite OpenBLAS is installed:

AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
/usr/bin/ld: cannot find -lopenblas
collect2: ld devolvió el estado de salida 1
make: *** [.build_release/lib/libcaffe.so] Error 1

Is there a solution for it?

like image 748
sator.arepo.tenet.opera.rotas Avatar asked Sep 02 '15 12:09

sator.arepo.tenet.opera.rotas


2 Answers

Including the base packs even after cloning OpenBlas and making will link the appropriate libraries in 14.04 and 16.

apt install liblapack-dev liblapack3 libopenblas-base libopenblas-dev

apt install liblapack-dev liblapack3 libopenblas-base libopenblas-dev

like image 157
Fitch Avatar answered Nov 12 '22 00:11

Fitch


I faced the same problem. Even adding library directory "/opt/OpenBLAS/lib/" to ldconfig cache didn't help (as my libopenblas.so is at "/opt/OpenBLAS/lib/libopenblas.so").

Using cmake helped me. Try this from caffe root directory:

mkdir build cd build cmake -DBLAS=open .. make all make runtest

If you need to use make, add the symlink of libopenblas.so to /usr/lib. I did the following:

ln -s /opt/OpenBLAS/lib/libopenblas.so /usr/lib/libopenblas.so

like image 6
vivkul Avatar answered Nov 12 '22 01:11

vivkul