matlab中codegen是什么,matlab中mcc编译器参数的含义
創建動態鏈接庫主要有兩種方法: 一種是使用Matlab 為VC++
IDE提供的Add-in。這種方法比較簡單,方便快捷,只要在VC++中創建工程的時候選擇Matlab Project
Wizard,并且在接下來的Step 1 中的Visual Matlab Application Type選擇Shared M-DLL
就可以了。接下來就是添加*.m 文件, 進行編譯了。另一種方法就是使用Matlab 的mcc 命令將*.m文件編譯為動態鏈接庫(
*.DLL)。因為Add-in 也是調用Compiler 的命令mcc 進行編譯工作的, 而且有時候這個Add-in
還會出現不能使用的情況, 因此這里主要討論使用mcc 命令的方法。
關于mcc 有很多參數可以使用, 而且有多種用法,主要參數如下:
Bold entries in the Comment/Options column indicate default
values
-a filename
Add filename to the CTF archive
無
-b
Generate Excel-compatible formula function
Requires MATLAB Builder for Excel
-B filename[:arg[,arg]]
Replace -B filename on the mcc command line with the contents of
filename
The file should contain only mcc command line options. These are
MathWorks included options files:
-B csharedlib:fooC shared library
-B cpplib:fooC++ library
-c
生成C語言包裝函數
Equivalent to
-T codegen
-d directory
輸出到指定目錄
無
-f filename
Use the specified options file, filename, when calling
mbuild
mbuild -setup is recommended.
-g
生成 debugging 信息
無
-G
同 -g
無
-I directory
Add directory to search path for M-files
MATLAB path is automatically included when running from MATLAB,
but not when running from DOS/UNIX shell.
-l
創建庫函數的宏
等效于命令
-W lib -T link:lib
-m
生成C語言獨立運行程序的宏
等效于命令
-W main -T link:exe
-M string
傳遞字符串給 mbuild
Use to define compile-time options.
-N
Clear the path of all but a minimal, required set of
directories
無
-o outputfile
制定最終可執行文件的名字
Adds appropriate extension
-P directory
Add directory to compilation path in an order-sensitive
context
Requires -N option
-R option
Specify run-time options for MCR
option =
-nojvm
-nojit
-S
Create Singleton MCR
Requires MATLAB Builder for COM
-T target
Specify output stage
target
=codegen?compile:bin?link:bin
where bin =exe
lib
-v
顯示詳細; 顯示編譯步驟
無
-w option
顯示警告信息
option = list
level?level:string
where level =disable
enable
error
-W type
Control the generation of function wrappers
type
=?main?cpplib:
lib:
none?com:compname,clname,version
-Y licensefile
Use licensefile when checking out a Compiler license
無
-z path
指定庫文件和包含文件的路徑
無
-?
顯示幫助信息
無
Feedback
總結
以上是生活随笔為你收集整理的matlab中codegen是什么,matlab中mcc编译器参数的含义的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机专硕考数一英一的学校有哪些,这所2
- 下一篇: python卸载与扩展包卸载