Assuring mex compatibility on different systems

39 visualizaciones (últimos 30 días)
Brian
Brian el 10 de Ag. de 2016
Comentada: Walter Roberson el 27 de Abr. de 2018
Hi there,
I'm looking at creating some mex libraries that will be used by other people. I need to know what is involved with assuring compatibility across different systems. I need to have support for Linux, Windows, and Mac OS X.
In general, I understand the mex file-suffix naming conventions that represent system OS and architecture, such as .mexw32 for x86 Windows, .mexw64 for x64 Windows, mexa32, mexa64 for linux x86 and x64 respectively, mexmaci, and mexmaci64 for Mac OS x86 and x64 respectively.
However, I am unsure if there are any additional stipulations for assuring compatibility of sharing mex files to users who are using MATLAB in a variety of environments.
For example, if I build a mex on my Windows 7 x64 machine with MATLAB 2015a, will another user be able to run it just fine with Windows 10 x64 and MATLAB 2016a?
What about building on Ubuntu 16, will a user using Ubuntu 12 be able to run the mex?
So I really need to know how cross-system compatibility of pre-compiled mexed code is supported, or not?
I don't want other users to have to bother with the process of compiling my mex, and I want to provide mex files of my code that will be supported on a wide range of systems. What do I have to know to make this possible?
Thanks, Brian

Respuesta aceptada

James Tursa
James Tursa el 11 de Ag. de 2016
There is NO assured compatibility of compiled mex code across different versions, operating systems, or platforms. The only assured compatibility for compiled mex code is to run under the same MATLAB version on the same operating system and platform. You might be lucky and get the same mex code to run under a different MATLAB version, but it just depends on what versions are involved as to whether you will get lucky or not. Your goal of having a single mex routine that can seamlessly be run by users across different MATLAB versions etc cannot in general be realized.
  7 comentarios
Matt J
Matt J el 27 de Abr. de 2018
version-specific issues perhaps, but platform-specific issues?
Walter Roberson
Walter Roberson el 27 de Abr. de 2018
I was responding to Brian's question about "Is it then generally safe"

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by