Permission Denied when compile Caffe by "make all"

2,261 views
Skip to first unread message

Steve Lu

unread,
Dec 18, 2014, 11:19:47 PM12/18/14
to caffe...@googlegroups.com
Hi,

When I was compiling Caffe with Matlab interface by make all, I got the following wrong message at the beginning:

make: execvp: /usr/local/MATLAB/R2014a: Permission denied

I modified line 40-43 of the file Makefile.config, which is actually uncomment the third line to enable the Matlab directory.

# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
MATLAB_DIR := /usr/local/MATLAB/R2014a
# MATLAB_DIR := /Applications/MATLAB_R2012b.app

If I comment the third line, the make all process works.

The platform is Ubuntu 14.04. Could you please advise me any solution to this? Thanks!

Ildoo Kim

unread,
Dec 19, 2014, 12:37:30 AM12/19/14
to caffe...@googlegroups.com
Have you tried with 'sudo make all' instead of 'make all' ?

Steve Lu

unread,
Dec 19, 2014, 12:41:24 AM12/19/14
to caffe...@googlegroups.com
Yes, I tried, but failed. I also found that if I make all the Caffe without this line in Makefile.config (which runs correctly) and after the compilation, I still cannot compile Matlab wrapper by make matcaffe. Thanks!

sel...@tcd.ie

unread,
Dec 19, 2014, 5:25:13 AM12/19/14
to caffe...@googlegroups.com
I have the same problem as Steve Lu ......

Siavash Sakhavi

unread,
Jun 8, 2015, 9:06:23 AM6/8/15
to caffe...@googlegroups.com
Did anyone solve this problem?

Fabian S

unread,
Jun 22, 2015, 10:18:56 AM6/22/15
to caffe...@googlegroups.com

Hey,

I had the same problem and it seems that something in the cmake files is wrong.
I changed the shell for compilation to /bin/bash and it showed 'XX is a directory' instead of 'Permission denied'.
Use 'make SHELL=/bin/bash all' for that.
If you're facing the 'XX is a directory' problem than proceed as follows:

- To fix the issue you have to change the 'build.make' file in 'BUILD_DIR/matlab/CMakeFiles/matlab.dir/'.
- Search for '/usr/local/MATLAB/R2014a' and replace it with' /usr/local/MATLAB/R2014a/bin/mex'
- Now rerun 'make all' again and everything should be fine.

Good luck

Alysa Leong

unread,
Jul 8, 2015, 12:01:02 PM7/8/15
to caffe...@googlegroups.com
Hi Fabian,

When I try to do make SHELL =/bin/bash all, I get:
make: *** empty variable name.  Stop.
I run this command from the caffe folder.

I'm not sure what I'm doing wrong.

Also, I am new to Caffe, so when I go to install the matlab interface, do I do:
make matcaffe
make all
or
make all matcaffe
or
make all
make matcaffe
? Does it matter?

Yixin Jin

unread,
Oct 4, 2016, 10:52:40 PM10/4/16
to Caffe Users

where can I find the path BUILD_DIR/matlab/CMakeFiles/
matlab.dir

On Monday, June 22, 2015 at 10:18:56 AM UTC-4, Fabian S wrote:

Wei Yang

unread,
Oct 20, 2016, 4:45:10 AM10/20/16
to Caffe Users
I found that this happens when there is an extra space after the matlab path in the Makefile.config file.

在 2014年12月19日星期五 UTC+8下午12:19:47,Steve Lu写道:

ziwei...@gmail.com

unread,
Mar 19, 2017, 2:22:53 AM3/19/17
to Caffe Users
Yes that's right. Thanks Yang you saved much of my time!

Kun Kelvin Liu

unread,
Dec 14, 2017, 10:31:42 AM12/14/17
to Caffe Users
Yes, you are right! Thank you for saving my time!!

在 2016年10月20日星期四 UTC+8下午4:45:10,Wei Yang写道:

leo.cha...@gmail.com

unread,
May 11, 2018, 7:59:55 AM5/11/18
to Caffe Users
There should be no extra space at the end of MATLAB_DIR := /usr/local/MATLAB/R2014a.


在 2014年12月19日星期五 UTC+8下午12:19:47,Steve Lu写道:
Hi,
Reply all
Reply to author
Forward
0 new messages