Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `cblas_*" #2353

Closed
wbtxd2004 opened this issue Apr 23, 2015 · 9 comments
Closed

undefined reference to `cblas_*" #2353

wbtxd2004 opened this issue Apr 23, 2015 · 9 comments

Comments

@wbtxd2004
Copy link

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!

@StevenLOL
Copy link

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

@wbtxd2004
Copy link
Author

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

@wincle
Copy link

wincle commented Jul 8, 2015

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.

vipuldivyanshu92 referenced this issue in vipuldivyanshu92/caffe Oct 3, 2015
Added opencv_imgcodecs to LIBRARIES , line 174.
This solves the make all error reported in BVLC#2348 and suggested by  @hongzhenwang and @binary42.
@vishwa15
Copy link

vishwa15 commented Oct 5, 2015

Thank you Wincle. It worked!!

@noldorj
Copy link

noldorj commented May 28, 2016

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

@northeastsquare
Copy link

@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/

@srbnghosh99
Copy link

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 to cblas_dgemm'
.build_release/lib/libcaffe.so: undefined reference to cblas_sscal' .build_release/lib/libcaffe.so: undefined reference to cblas_dgemv'
.build_release/lib/libcaffe.so: undefined reference to cblas_saxpy' .build_release/lib/libcaffe.so: undefined reference to cblas_ddot'
.build_release/lib/libcaffe.so: undefined reference to cblas_dasum' .build_release/lib/libcaffe.so: undefined reference to cblas_sgemm'
.build_release/lib/libcaffe.so: undefined reference to cblas_dscal' .build_release/lib/libcaffe.so: undefined reference to cblas_scopy'
.build_release/lib/libcaffe.so: undefined reference to cblas_sasum' .build_release/lib/libcaffe.so: undefined reference to cblas_daxpy'
.build_release/lib/libcaffe.so: undefined reference to cblas_dcopy' .build_release/lib/libcaffe.so: undefined reference to cblas_sdot'
collect2: error: ld returned 1 exit status
make: *** [.build_release/test/test_all.testbin] Error 1

@kviktor
Copy link

kviktor commented Apr 11, 2020

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.

@jmlago
Copy link

jmlago commented May 1, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants