[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Distinguish MEX files for different architectures

From: Jordi Gutiérrez Hermoso
Subject: Re: Distinguish MEX files for different architectures
Date: Tue, 28 Jun 2011 09:35:40 -0500

On 28 June 2011 04:41, ajimenezp <address@hidden> wrote:
> Hello,
> In MATLAB, MEX files compiled for different architectures get different
> extensions (.mexglx for 32-bit Linux, .mexa64 for 64-bit Linux, etc). And if
> you have two MEX files myfile.mexglx and myfile.mexa64 in the same
> directory, you simply invoke myfile() and Matlab will call the appropriate
> version. This is very convenient when running Matlab simulations in a
> cluster of computers, since a-priori it is difficult to know in what
> architecture your job will be running. All you need to do is login once in
> each type of machine, compile your MEX files, and leave them all in the same
> directory: the right version will be run, no-matter what the architecture is
> of the machine to which your job is finally assigned.
> Since Octave does not use different extensions for MEX files compiled in
> different architectures, can anyone propose a solution for this problem?

Just out of curiousity, how would you handle outside of Matlab and
Octave a comparable problem about "compiling once, run anywhere," in
the lingo of Java advertising? Suppose you had some pure C++ code that
needed to be run in clusters. Would you also use different filename

The filename extension thing to me seems like an ugly hack. I've only
ever seen it done with mex files. There aren't .exe64 or .dll64 or
.so64 filename extensions in common use, so why does Matlab do it?
Surely it suffices to compile the code for the architecture you're
going to run it in?

I guess we could patch Octave to recognise .oct64, .octmips, and
.octw32, octw64 extensions, but this seems a little ugly.

- Jordi G. H.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]