Caffe: undefined reference to `cblas_*"

Created on 23 Apr 2015  路  9Comments  路  Source: BVLC/caffe

When I make all to compile caffe, I got this error:
.build_debug/lib/libcaffe.so: undefined reference to cblas_dasum' .build_debug/lib/libcaffe.so: undefined reference tocblas_dcopy'
.build_debug/lib/libcaffe.so: undefined reference to cblas_sdot' .build_debug/lib/libcaffe.so: undefined reference tocblas_dscal'
.build_debug/lib/libcaffe.so: undefined reference to cblas_sgemm' .build_debug/lib/libcaffe.so: undefined reference tocblas_dgemm'
.build_debug/lib/libcaffe.so: undefined reference to cblas_sgemv' .build_debug/lib/libcaffe.so: undefined reference tocblas_sscal'
.build_debug/lib/libcaffe.so: undefined reference to cblas_scopy' .build_debug/lib/libcaffe.so: undefined reference tocblas_saxpy'
.build_debug/lib/libcaffe.so: undefined reference to cblas_dgemv' .build_debug/lib/libcaffe.so: undefined reference tocblas_sasum'

I use mkl as BLAS. How to solve this problem?
Thanks!

Most helpful comment

I also have this problem, check your Makefile.config , Is there leave one space after BLAS := open ?delete the space after "open",then recompile it.

All 9 comments

Do you have a "build" folder, once I got same problem when I build caffe in its own directory.

mkdir build
cd build
cmake ..
make

Please check this issue:

2348

Thank you! I use your method and successful installed caffe.

I also have this problem, check your Makefile.config , Is there leave one space after BLAS := open ?delete the space after "open",then recompile it.

Thank you Wincle. It worked!!

Hi. Were you able to solve this issue with Intel MKL ? I'm facing the same error.

@noldorj , iset mkl not MKL, solve
BLAS := mkl

Custom (MKL/ATLAS/OpenBLAS) include and lib directories.

Leave commented to accept the defaults for your choice of BLAS

(which should work)!

BLAS_INCLUDE := /opt/intel/mkl/include/
BLAS_LIB := /opt/intel/mkl/lib/intel64/

I am finding this error message when I am trying to make.

CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp
.build_release/lib/libcaffe.so: undefined reference to cblas_sgemv' .build_release/lib/libcaffe.so: undefined reference tocblas_dgemm'
.build_release/lib/libcaffe.so: undefined reference to cblas_sscal' .build_release/lib/libcaffe.so: undefined reference tocblas_dgemv'
.build_release/lib/libcaffe.so: undefined reference to cblas_saxpy' .build_release/lib/libcaffe.so: undefined reference tocblas_ddot'
.build_release/lib/libcaffe.so: undefined reference to cblas_dasum' .build_release/lib/libcaffe.so: undefined reference tocblas_sgemm'
.build_release/lib/libcaffe.so: undefined reference to cblas_dscal' .build_release/lib/libcaffe.so: undefined reference tocblas_scopy'
.build_release/lib/libcaffe.so: undefined reference to cblas_sasum' .build_release/lib/libcaffe.so: undefined reference tocblas_daxpy'
.build_release/lib/libcaffe.so: undefined reference to cblas_dcopy' .build_release/lib/libcaffe.so: undefined reference tocblas_sdot'
collect2: error: ld returned 1 exit status
make: * [.build_release/test/test_all.testbin] Error 1

I had the same issue on Manjaro (I'm reporting here cause this is the first hit on Google), as far as I understood the issue was that the openblas library doesn't include all bindings (https://bugs.archlinux.org/task/66092) so I had to install https://aur.archlinux.org/packages/openblas-lapack/ instead.

git clone https://aur.archlinux.org/openblas-lapack.git
cd openblas-lapack
makepkg -si

With this I could build caffe.

I had the same issue on Manjaro (I'm reporting here cause this is the first hit on Google), as far as I understood the issue was that the openblas library doesn't include all bindings (https://bugs.archlinux.org/task/66092) so I had to install https://aur.archlinux.org/packages/openblas-lapack/ instead.

git clone https://aur.archlinux.org/openblas-lapack.git
cd openblas-lapack
makepkg -si

With this I could build caffe.

Many thanks, installing openblas-lapack with yay, I was able to compile and install caffe in Manjaro without any problems

Was this page helpful?
0 / 5 - 0 ratings

Related issues

malreddysid picture malreddysid  路  3Comments

dfotland picture dfotland  路  3Comments

LarsHH picture LarsHH  路  3Comments

Ruhjkg picture Ruhjkg  路  3Comments

prathmeshrmadhu picture prathmeshrmadhu  路  3Comments