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

18 ビュー (過去 30 日間)
Sylvain
Sylvain 2025 年 11 月 4 日 11:23
回答済み: Abhipsa 2025 年 11 月 7 日 10:28
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.

回答 (1 件)

Abhipsa
Abhipsa 2025 年 11 月 7 日 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

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品


リリース

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by