在Matlab中构建C mex文件时出错:权限被拒绝

时间:2013-11-23 13:54:05

标签: matlab mex

我试图在matlab中编译C代码。

我使用matlabroot/extern/examples子文件夹中的简单示例代码进行了测试。我做了以下事情:

mex -setup
copyfile(fullfile(matlabroot,'extern','examples','mex', 'yprime.c'), './');
mex -v -g yprime.c

命令行输出以下信息,我想这应该是路径问题,但我不知道如何解决它。

**************************************************************************
 Warning: Neither -compatibleArrayDims nor -largeArrayDims is selected. 
           Using -compatibleArrayDims. In the future, MATLAB will require
           the use of -largeArrayDims and remove the -compatibleArrayDims
           option. For more information, see:
           http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
**************************************************************************

find: /.DocumentRevisions-V100: Permission denied
find: /.fseventsd: Permission denied
find: /.Spotlight-V100: Permission denied
find: /.Trashes: Permission denied
cfind: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
find: /Library/Application Support/Apple/ParentalControls/Users: Permission denied
find: /Library/PreferencePanes/TeXDistPrefPane.prefPane: Permission denied
find: /Library/Server/Mail/Data/mta: Permission denied
find: /Library/Server/Mail/Data/spool/active: Permission denied
find: /Library/Server/Mail/Data/spool/bounce: Permission denied
find: /Library/Server/Mail/Data/spool/corrupt: Permission denied
find: /Library/Server/Mail/Data/spool/defer: Permission denied
find: /Library/Server/Mail/Data/spool/deferred: Permission denied
find: /Library/Server/Mail/Data/spool/flush: Permission denied
find: /Library/Server/Mail/Data/spool/hold: Permission denied
find: /Library/Server/Mail/Data/spool/incoming: Permission denied
find: /Library/Server/Mail/Data/spool/maildrop: Permission denied
find: /Library/Server/Mail/Data/spool/private: Permission denied
find: /Library/Server/Mail/Data/spool/public: Permission denied
find: /Library/Server/Mail/Data/spool/saved: Permission denied
find: /Library/Server/Mail/Data/spool/trace: Permission denied

任何人都可以提供帮助吗?

1 个答案:

答案 0 :(得分:1)

可能任何Matlab实例都已调用过mex文件。在这种情况下,请使用“全部清除”命令清除每个实例的所有变量,然后重试。另外,操作系统的其他某些过程可能正在锁定mex文件。尝试找出谁锁定了该文件并将其解锁。