MATLAB 编译器处理来自不相关工具箱的 mcc.enc

标签 matlab matlab-deployment matlab-compiler mcc

我正在使用 mcc 编译我的 MATLAB 项目。我使用的机器上安装了很多 MATLAB 工具箱,但我的代码只需要几个(例如 distcomp 和图像)。但是,每当我运行 mcc 时,它最终都会“处理”许多工具箱的 mcc.enc 文件,包括那些我的代码不需要的工具箱。

这是 mcc 输出的开头(我使用 -R '-nodisplay' 运行它以与我正在使用的集群兼容)。

Warning: No display specified.  You will not be able to display graphics on the screen.
Compiler version: 4.15 (R2011a)
Processing /cm/shared/apps/matlab/7.12.0/toolbox/matlab/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/distcomp/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/images/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/stats/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/shared/imageslib/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/shared/system/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/shared/spcuilib/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/control/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/shared/controllib/engine/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/shared/controllib/general/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/signal/mcc.enc
Processing /cm/shared/apps/matlab/7.12.0/toolbox/nnet/mcc.enc

我注意到它在我的桌面上运行 mcc 时也会做同样的事情。其中一些 mcc.enc 文件(尤其是 .../signal/mcc.enc 和 .../nnet/mcc.enc)比执行其余的 mcc 文件需要更多的时间来处理。有什么方法可以排除处理不需要的 mcc.enc 文件吗?

最佳答案

使用 MATLAB IDE 中的“部署工具”,进入项目设置并从“路径上的工具箱”选项卡中取消选择所有不需要的工具箱。

screenshot

还有一个mcc参数-N从路径中清除所有文件夹,只保留核心 MATLAB 文件夹。

-N Clear Path

Passing -N effectively clears the path of all folders except the following core folders (this list is subject to change over time):

  • matlabroot/toolbox/matlab
  • matlabroot/toolbox/local
  • matlabroot/toolbox/compiler/deploy

It also retains all subfolders of the above list that appear on the MATLAB path at compile time. Including -N on the command line allows you to replace folders from the original path, while retaining the relative ordering of the included folders. All subfolders of the included folders that appear on the original path are also included. In addition, the -N option retains all folders that the user has included on the path that are not under matlabroot/toolbox.

关于MATLAB 编译器处理来自不相关工具箱的 mcc.enc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11567019/

相关文章:

matlab - 在 MATLAB 中对条形图进行排序

matlab - 使用 MATLAB 命令保存特定文件

matlab 静态方法是不必要的,对吧?

matlab - 我如何为已编译的 MATLAB 创建一个安装程序,要求用户接受我们的许可条款?

c++ - 从 C++ 调用 MATLAB 错误 : unresolved external symbol

java - 如何运行Matlab编译的Java函数?

java - Matlab编译器运行时安装文件找不到Java运行时环境

matlab - 矩阵中元素的总和使用matlab的求和函数

matlab - 向量化矩阵中不同对角线的总和

matlab - Octave/Matlab - 无法/绘制数据