What is the difference between functions like mclmcrInitialize and mclInitializeApplication?
조회 수: 3 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2011년 5월 4일
편집: MathWorks Support Team
2022년 10월 14일
I have created shared libraries using the MATLAB Compiler. The documentation mentions that the driver application needs to make use of MATLAB Compiler Runtime (MCR) functions like mclmcrInitialize and mclInitializeApplication.
What is the difference between these functions and when should they be used?
채택된 답변
MathWorks Support Team
2022년 10월 14일
편집: MathWorks Support Team
2022년 10월 14일
mclmcrInitialize and mclInitializeApplication are MATLAB Compiler Runtime (MCR) functions which are typically used in driver applications for shared libraries.
mclInitializeApplication: This function should be called once at the beginning of your driver application. You must make this call before calling any other MathWorks functions.
mclmcrInitialize: Loads three main libraries (libmex,libmat.libmclmcr) and sets runtime environment for running MATLAB functions.
If the driver application has a main() method, you need to use mclInitializeApplication in the main() method. This in turn calls mclmcrInitialize to load all the libraries.
For example, refer to the following C shared library example:
If the driver application has a main() as well as an additional method which uses the mclRunMain function, you must first call mclmcrInitialize. Then inside the function called from mclRunMain, you can call mclInitializeApplication to complete the MCR initialization procedure. mclRunMain is an additional MCR function which handles platform specific threading issues.
For example, refer to the following C++ shared library example:
In this example, run_main() is the additional method which is called by the mclRunMain function.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!