Skip to content
Tech News
← Back to articles

Python Package Compiler:Package Matlab Programs for Deployment as Python Package

read original get Matlab Compiler Runtime (MCR) → more articles
Why This Matters

The Python Package Compiler enhances the deployment of MATLAB programs as Python packages by obfuscating internal structures and encrypting user code, improving security and ease of distribution. This development is significant for the tech industry as it streamlines cross-platform deployment and protects intellectual property, benefiting both developers and end-users.

Key Takeaways

Obfuscate folder structures, file names, and user code in the deployable archive. If you enable this property, then folder structures and file names in the deployable archive are obfuscated from the end user, and user code and data contained in .m , .mlapp , .p , .mat , MLX, SFX, and MEX files are placed into a user package within the archive. Additionally, all .m files are converted to P-files before packaging.

During runtime, MATLAB code and data is decrypted and loaded directly from the user package rather than extracted to the file system. MEX files are temporarily extracted from the user package before being loaded.

To manually include additional file types in the user package, add each file type in a separate extension tag to the file matlabroot /toolbox/compiler/advanced_package_supported_files.xml .

The following are not supported:

ver function

Calling external libraries such as DLLs

Out-of-process MATLAB Runtime (C++ shared library for MATLAB Data Array)

Out-of-process MEX file execution ( mexhost , feval , matlab.mex.MexHost )

Before R2023b: .mat files other than v7.3

Enabling this option is equivalent to using mcc with -j and -s specified.

... continue reading