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

18 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Abhipsa
Abhipsa il 7 Nov 2025 alle 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

Categorie

Scopri di più su MATLAB Compiler in Help Center e File Exchange

Prodotti


Release

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by