faster_rcnn icon indicating copy to clipboard operation
faster_rcnn copied to clipboard

Cannot compile matcaffe with matlab 2012a

Open AndsonYe opened this issue 9 years ago • 10 comments

Hi,

I got a problem with compiling caffe. When I run "make matcaffe" I got an error, the outputs are as below: MEX matlab/+caffe/private/caffe_.cpp

Warning: You are using gcc version "4.8.2-19ubuntu1)". The version currently supported with MEX is "4.4.6". For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release/

matlab/+caffe/private/caffe_.cpp:19:28: fatal error: gpu/mxGPUArray.h: No such file or directory #include "gpu/mxGPUArray.h" ^ compilation terminated.

mex: compile of ' "matlab/+caffe/private/caffe_.cpp"' failed.

make: *** [matlab/+caffe/private/caffe_.mexa64] Error 1

I am using matlab 2012a on my server. And I have search about this problem while I got answer that there is a mxGPUArray.h file in \MATLAB\R2014a\toolbox\distcomp\gpu\extern\include\gpu, however 2012a version seems do not have this file. Because the server is shared by several labmates, I am afraid reinstall the matlab to another version will affect others' program. So is there anyway to solver this problem without chaging the matlab version?

Thanks.

AndsonYe avatar Oct 03 '15 07:10 AndsonYe

matlab2014 is work for me

samuel1208 avatar Oct 13 '15 02:10 samuel1208

Got exactly the same problem here. I'm using Matlab 2015a. And the mxGPUArray.h file is lying at: .../MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/gpu/


matlab/+caffe/private/caffe_.cpp:19:28: fatal error: gpu/mxGPUArray.h: No such file or directory compilation terminated.

mex: compile of ' "matlab/+caffe/private/caffe_.cpp"' failed.

make: *** [matlab/+caffe/private/caffe_.mexa64] Error 255

deartonym avatar Oct 16 '15 03:10 deartonym

Thanks @deartonym!

I had the same problem, and solved by 1) adding variable MATLAB_INCLUDE := ./MATLAB/R2014a/toolbox/distcomp/gpu/extern/include and 2) changing INCLUDE_DIRS := ... as INCLUDE_DIRS := $(PYTHON_INCLUDE) $(MATLAB_INCLUDE) /usr/local/include in Makefile.config

lim0606 avatar Oct 21 '15 00:10 lim0606

I had the same problem and solved by add: MATLAB_DIR := /usr/local/MATLAB/R2014b to the Makefile.config

lianliGao avatar Nov 19 '15 10:11 lianliGao

I had the same problem with Matlab 2012a. I might be that Matlab 2012a does not have that file.

antran89 avatar Feb 16 '16 13:02 antran89

@lim0606 Just saw your post lol, thank you very much and your solution is definitely correct! Thanks again!

deartonym avatar May 14 '16 03:05 deartonym

thanks @lim0606 , your solution works. By the way, I only meet the problem when making matcaffe in caffe version of Faster RCNN.

ch977 avatar Nov 19 '16 09:11 ch977

I got the same error as @taozuoqiao , any help?

afgenovese avatar Dec 20 '16 09:12 afgenovese

I had also got the same error. There is a very simple solution.

  1. Create a new folder in ...\MATLAB\R2014a\extern\include. Rename it to gpu.
  2. In that folder copy-paste mxGPUarray.h from ...\MATLAB\R2014a\toolbox\distcomp\gpu\extern\include\gpu to ...\MATLAB\R2014a\extern\include\gpu.

This worked for me.

rahulvenkk avatar Jan 01 '17 11:01 rahulvenkk

Hey @lim0606 can you please specify where do I make the changes , i.e where is the Makefile.config located ? I am trying to compile Matconvnet using GPU in ubuntu and I am getting the similar error .

rishabh135 avatar Apr 08 '17 15:04 rishabh135