フィルターのクリア

Can't compile MEX-files under OS X Lion... even with patch!

1 回表示 (過去 30 日間)
louise
louise 2011 年 12 月 7 日
Hello!
Trying to compile the MEX example as shown here:
Installed the patch as shown here:
But I get this error:
>> mex yprime.c
/var/folders/ks/xd_bvtl16fx5m10g8w6t1f9h0000gp/T//cc5jjKJx.s:unknown:FATAL:can't create output file: yprime.o
mex: compile of ' "yprime.c"' failed.
I can't find any support anywhere in the docs. Can anyone help?
Thanks!
Louise :)

採用された回答

louise
louise 2011 年 12 月 8 日
SOLVED.
You need to run Matlab as root.
This is done in OS X by cd'ing to the bin directory inside the Matlab app and running the matlab executable in there with sudo.
You can write your own script to automate this.

その他の回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2011 年 12 月 7 日
Try running:
mex -v yprime.c
This should give you a verbose output of the "mex" command that should give you a better idea of the issue.
Also, make sure that you have write permissions in your drive (on Windows 7, for example, MATLAB needs to be "run as administrator" to be able to write to disk).
  2 件のコメント
louise
louise 2011 年 12 月 8 日
Thanks! Tried that and same output though.
louise
louise 2011 年 12 月 8 日
Your hint about running as admin really helped :)

サインインしてコメントする。


Ken Atwell
Ken Atwell 2012 年 1 月 12 日
Rather than run MATLAB as root, I would encourage you first copy any MEX example file that ships with MATLAB to a folder that you can write to without being root. For example:
cd ~/Documents/MATLAB
copyfile([matlabroot '/extern/examples/refbook/timestwo.c'])
mex timestwo.c
timestwo(512)
This is probably only at issue with the examples that ship with MATLAB; presumably you keep your own source code in user-writeable folders.
You also have the option of using MEX's -o switch to control where MEX writes files.
  1 件のコメント
louise
louise 2012 年 1 月 18 日
Even better, good work Ken

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by