couldn't run codegen under matlab
显示 更早的评论
I have trial version of matlab coder,and download a sample coder from mathwork: hello_world. and followed the instruction of how to setup and run the sample.
when I tried to run codegen to generate mex function within matlab, I get a error message like: >> codegen hello_world ??? cp: preserving permissions for `/var/local/scratch/qguan/coder2/coderdemo_hello_world/codegen/mex/hello_world/mexopts.sh': Operation not supported
I checked uid and gid for the current workfolder, it is set all fine and rw enabled.
what else I should be looking into? or is it known issue?
Thanks so much for your help! Qingyan
采纳的回答
更多回答(1 个)
Walter Roberson
2011-5-25
0 个投票
It sounds as if at some point the script is executing the Linux command
cp -p SomeFile /var/local/scratch/qguan/coder2/coderdemo_hello_world/codegen/mex/hello_world/mexopts.sh
(Or --preserve instead of -p)
and that for some reason keeping the permissions is not possible.
Sometimes preserving permissions is not possible with networked file systems.
What I would probably do is fine the "cp" line and remove the "-p" or "--preserve" option.
6 个评论
Qingyan
2011-5-25
Kaustubha Govind
2011-5-25
Could it be that there is a firewall-like software that doesn't allow MATLAB to run with the same privileges as when you run from shell?
Walter Roberson
2011-5-25
Firewall-like software seems unlikely for Linux.
Differences in operation are possible if codegen or something it exec()'s is suid or sgid for some reason.
I can tell from the message that "cp" itself is being executed at some level. You could probably determine where using Linux's strace.
Qingyan
2011-5-25
Walter Roberson
2011-5-25
The documentation for copyfile is inconsistent with copyfile being equivalent to cp -p . The copyfile documentation indicates, "The read-only and archive attributes of source are not preserved in destination." but the point of cp -p is to preserve at least the read-only attribute.
Kaustubha Govind
2011-5-26
@Qingyan: Have you tried running either:
!cp -p /some/source /some/destination
or
system('cp -p /some/source /some/destination')
Do they work okay?
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!