Reputation: 1135
I have tried to compile C code in matlab.
I tested with the simple example code in the matlabroot/extern/examples
subfolders. I did the following:
mex -setup
copyfile(fullfile(matlabroot,'extern','examples','mex', 'yprime.c'), './');
mex -v -g yprime.c
The command line outputs the following information, which I guess should be a path problem, but I don't know how to solve it.
**************************************************************************
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
Anyone can help?
Upvotes: 0
Views: 1579
Reputation: 11
Probably the mex file has been called before by any instance of Matlab. In this case, clear all variables at each instance using "clear all" command and try again. Also, some other process of your operating system may be locking the mex file. Try to find out who is locking that file and unlock it.
Upvotes: 1