MEX for different platforms - deployment question.
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
HI,
I have some software than will be used by different members of a team. Everyone has matlab, but annoyingly on different platforms (i.e. Linux, Win and OSX).
There is some fortran mex involved, which compiles without problem on Linux, but annoyingly we don't have compatible Fortran compilers on Windows (or MAc, but that's probably in Xcode somewhere I guess).
My question is can you use mex to compile for different targets? So on the linux machine (gfortran) it makes xxxx.mexa64, is it possible to get it to make xxxx.mexw64 and xxxx.mexmaci with some switch or something?
I have coder, but don't see how that would help because the source is Fortran.
My third option would be maybe to build the Fortran as a shared library in each case and try 'loadlibrary' maybe?
So basically, I'm developing on Linux, the code needs a Fortran mex but I need to be able to deploy on Mac and Windows also. What's considered best practice for this kind of thing?
Cheers,
Arwel
1 commentaire
Walter Roberson
le 20 Mar 2019
Modifié(e) : Walter Roberson
le 20 Mar 2019
Note: the only supported Fortran for Mac is Intel Parallel Studios https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/system-requirements-release-2018b-supported-compilers.pdf . You might be able to hack g77 to work, but it is not supported.
Réponses (1)
Walter Roberson
le 20 Mar 2019
No; you have to compile on a compatible system. The only cross-compilation support that existed historically was that you used to be able to target Windows 32 bit systems while running on Windows 64 bit.
On Linux you just might be able to work something out involving Vine or similar to run Windows in parallel, but it would probably be a nuisance.
0 commentaires
Voir également
Catégories
En savoir plus sur Fortran with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!