What is the difference between functions like mclmcrInitialize and mclInitializeApplication?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 4 Mai 2011
Bearbeitet: MathWorks Support Team
am 14 Okt. 2022
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?
Akzeptierte Antwort
MathWorks Support Team
am 14 Okt. 2022
Bearbeitet: MathWorks Support Team
am 14 Okt. 2022
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu C Shared Library Integration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!