Question on gihub file and file exchange involving Mex files and git submodule in Matlab Project

16 visualizaciones (últimos 30 días)
I am working on a TOML parser based on Tomlplusplus: https://github.com/sylvanoMTL/Matlab-tomlplusplus
The github works on by compiling mex functions. that are calling routines from the git submodule tomlplusplus.
Should I add the compiled mex files (win64) to the project? are these mex file reusable by other Win64 machines?
Do I need to compile mex files for unix/mac? and can I do that using my computer win64?
In that way the user won't have to recompile the mex functions. but I have the feel it is machine dependent.

Respuestas (1)

Abhipsa
Abhipsa el 7 de Nov. de 2025 a las 10:28
I would like to answer ypur questions seprately:
1. “Should I add compiled .mexw64 to the project? Are they reusable?”
Yes. They should run on other Win64 machines with a compatible MATLAB release and the right MSVC runtime. They are not tied to your machine, but they are tied to OS/arch/release/compiler.
2. “Do I need to compile for Unix/mac?”
If you want out-of-the-box support there, yes you can provide .mexa64 and .mexmaci64 too. Otherwise, ship sources and a build script so those users can mex locally.
3. “Can I build mac/linux MEX from my Windows box?”
No. MATLAB MEX doesn’t support cross-compiling between OSes; build natively on each platform (or use CI runners for each OS)
You can refer to the following MATLAB documentations and forum links for more details:
I hope this resolves your query

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Productos


Versión

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by