BLAS conflict when compile with Caffe support


#1

Hi guys, I encountered such a problem when compile MXNet with Caffe support. I set USE_BLAS=mkl for Caffe first and then for MXNet. But there are some errors related to BLAS conflict. Any suggestions would be really appreciated.

In file included from /home/yzma/proj/third-party/caffe/include/caffe/util/mkl_alternate.hpp:14:0,
from /home/yzma/proj/third-party/caffe/include/caffe/util/math_functions.hpp:11,
from /home/yzma/proj/third-party/caffe/include/caffe/layer.hpp:12,
from plugin/caffe/caffe_blob.h:32,
from plugin/caffe/caffe_blob.cc:26:
/usr/include/cblas.h:19:29: error: redeclaration of ‘CblasRowMajor’
typedef enum {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;
^
In file included from /home/yzma/proj/third-party/incubator-mxnet/mshadow/mshadow/./base.h:151:0,
from /home/yzma/proj/third-party/incubator-mxnet/mshadow/mshadow/tensor.h:16,
from include/mxnet/./base.h:32,
from include/mxnet/tensor_blob.h:38,
from plugin/caffe/caffe_blob.h:29,
from plugin/caffe/caffe_blob.cc:26:
/opt/intel/mkl/include/mkl_cblas.h:49:15: note: previous declaration ‘CBLAS_LAYOUT CblasRowMajor’
typedef enum {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;
^
In file included from /home/yzma/proj/third-party/caffe/include/caffe/util/mkl_alternate.hpp:14:0,
from /home/yzma/proj/third-party/caffe/include/caffe/util/math_functions.hpp:11,
from /home/yzma/proj/third-party/caffe/include/caffe/layer.hpp:12,
from plugin/caffe/caffe_blob.h:32,
from plugin/caffe/caffe_blob.cc:26:
/usr/include/cblas.h:19:48: error: redeclaration of ‘CblasColMajor’
typedef enum {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;
^


#2

I’ve done this with openblas and it works. Never tried mkl. Does openblas work for you or do you see this problem with openblas too?


#3

Em…I tried a naive way… just comment out those lines related to cblas and it works…


#4

I didn’t try openblas because I need some sparse matrix calculation supported by MKL.