f



create 32 bit mex files from 64 bit matlab?

platform: osx, intel
matlab: 7.9.0.529 (R2009b), 64-bit (maci64), August 12, 2009

I want to create .mexmaci files using mex, but it looks like I have no way to create them using the mex that ships with this version of matlab.  

Even if I use 'mex -arch maci ', it still only creates '.mexmaci64' files.

Is there a simple way around this, or do I have to keep a 32 bit version of matlab around to create the '.mexmaci' files?

Regards,
Sriram
0
sriram1 (1)
10/2/2009 1:49:04 PM
comp.soft-sys.matlab 211266 articles. 24 followers. lunamoonmoon (257) is leader. Post Follow

4 Replies
1189 Views

Similar Articles

[PageSpeed] 9

Sriram Swaminarayan wrote, On 10/2/2009 7:49 AM:
> platform: osx, intel
> matlab: 7.9.0.529 (R2009b), 64-bit (maci64), August 12, 2009
> 
> I want to create .mexmaci files using mex, but it looks like I have no way to create them using the mex that ships with this version of matlab.  
> 
> Even if I use 'mex -arch maci ', it still only creates '.mexmaci64' files.
> 
> Is there a simple way around this, or do I have to keep a 32 bit version of matlab around to create the '.mexmaci' files?

The latter.  The mex file needs to link against the appropriate 32bit 
Matlab libraries, which are only available with the 32bit installation.

Dan
0
10/6/2009 3:52:41 PM
On 2 Okt, 15:49, "Sriram Swaminarayan" <sri...@lanl.gov> wrote:
> platform: osx, intel
> matlab: 7.9.0.529 (R2009b), 64-bit (maci64), August 12, 2009
>
> I want to create .mexmaci files using mex, but it looks like I have no wa=
y to create them using the mex that ships with this version of matlab. =A0
>
> Even if I use 'mex -arch maci ', it still only creates '.mexmaci64' files=
..
>
> Is there a simple way around this, or do I have to keep a 32 bit version =
of matlab around to create the '.mexmaci' files?

It depends on the compiler, which needs to be able to
produce both 32-bit and 64-bit dlls and executables.
Once you have such a compiler (not all compilers can
do this), you will need to trick matlab/MEX to call the
compiler in 32-bit mode instead of 64-bit mode. Which
may or may not be possible.

Last, you might need to use matlab in 32-bit mode in
order to test the MEX file.

It might be most convenient to install a 32-bit
version of matlab on your 64-bit system, and do all
the 32-bit mex stuff under this version.

Provided, of course, that a 64-bit and a 32-bit matlab
can coexist on your system. Which may or may ot be the case.

Rune
0
allnor (8509)
10/6/2009 4:06:42 PM
Dan Hensley <somewhere@over.there.invalid> wrote in message <hafp2q$dj4$1@news.eternal-september.org>...

> > 
> > Is there a simple way around this, or do I have to keep a 32 bit version of matlab around to create the '.mexmaci' files?

I echo Dan here: you need to keep the 32-bit version of Matlab and compile with it.

Bruno
0
b.luong5955 (6401)
10/6/2009 4:36:20 PM
Hi,

Installing both maci and maci64 together on a Mac is supported, but 
cross-compiling a different architecture is not supported, and not 
advised.  You should always run the same architecture that you compile, 
so that you can test that what you compiled works.

If you have both architectures installed, you can control the MATLAB 
architecture to run using the "Open in 32-bit Mode" checkbox in the Get 
Info window for the MATLAB_R2009b application in the Finder.  To specify 
the architecture from Terminal or xterm, use 'matlab -maci' or 'matlab 
-maci64'.

With that said, it is actually possible to cross-compile :-). You only 
need both maci and maci64 installed, and 64-bit hardware.

The environment variable MACI64 can be used to control the architecture 
that the mex, mcc and matlab shell scripts default to. To change MEX to 
compile 32-bit mexmaci from 64-bit MATLAB, set the MACI64 environment 
variable to 0 before compiling with MEX. To change it back to compiling 
64-bit mexmaci64, set it to something other than 0.

Doing this has many hazards associated with it, so it's not supported, 
and my advice is that you always run the architecture you intend to 
compile, so that you can test your compiled code.

Good luck,

- Brian

Rune Allnor wrote:
> On 2 Okt, 15:49, "Sriram Swaminarayan" <sri...@lanl.gov> wrote:
>> platform: osx, intel
>> matlab: 7.9.0.529 (R2009b), 64-bit (maci64), August 12, 2009
>>
>> I want to create .mexmaci files using mex, but it looks like I have no way to create them using the mex that ships with this version of matlab.  
>>
>> Even if I use 'mex -arch maci ', it still only creates '.mexmaci64' files.
>>
>> Is there a simple way around this, or do I have to keep a 32 bit version of matlab around to create the '.mexmaci' files?
> 
> It depends on the compiler, which needs to be able to
> produce both 32-bit and 64-bit dlls and executables.
> Once you have such a compiler (not all compilers can
> do this), you will need to trick matlab/MEX to call the
> compiler in 32-bit mode instead of 64-bit mode. Which
> may or may not be possible.
> 
> Last, you might need to use matlab in 32-bit mode in
> order to test the MEX file.
> 
> It might be most convenient to install a 32-bit
> version of matlab on your 64-bit system, and do all
> the 32-bit mex stuff under this version.
> 
> Provided, of course, that a 64-bit and a 32-bit matlab
> can coexist on your system. Which may or may ot be the case.
> 
> Rune
0
10/6/2009 6:36:52 PM
Reply:

Similar Artilces:

32 bit matlab on 64 bit machine, mex files
I have a 64 bit machine with an (older) 32 bit version of matlab installed on it. I am wondering if it is possible to execute 64-bit mex files (compiled on a 64-bit machine). It seems like this should be possible as the CPU has a 64 bit instruction set. If not, is there a way to interface with 64-bit code (e.g. compile it into a dll that the 32-bit mex function would call). "Nick" wrote in message <kj44v1$6f8$1@newscl01ah.mathworks.com>... > I have a 64 bit machine with an (older) 32 bit version of matlab installed on it. I am wondering if it is possible to execute 64...

can Matlab support 32-bit matlab version scripts on 64-bit version of matlab
can Matlab support 32-bit matlab version scripts on 64-bit version of matlab in windows platform?.if yes , how is the performance better ? please do answer this question thank u "Gangamma " <gangvsng@gmail.com> wrote in message <hvmr7h$sn0$1@fred.mathworks.com>... > can Matlab support 32-bit matlab version scripts on 64-bit version of matlab in windows platform?.if yes , how is the performance better ? Yes, Matlab program written in 32/64 bits are compatible accepted MEX file. 64-bit version can handle larger array but does *NOT* improve speed. Br...

64-bit Matlab scripts on 32-bit Matlab?
Hello, I wish to use script which perform some simple calculations on NetCDF variables and store result values as a matrix. Author claims that script needs 64-bit MATLAB version installed on Linux machine. Unfortunately, although I have 64-bit machine, under Linux I have access to 32-bit MATLAB only. Following warning is returned: Error using class The CLASS function must be called from a class constructor. Could you tell me: - what (in terms of syntax, available functions, methods, objects) are the differences between 64-bit and 32-bit MATLAB? - is it possible to workaround su...

can Matlab support 32-bit matlab version scripts on 64-bit version of matlab #2
can Matlab support 32-bit matlab version scripts on 64-bit version of matlab in windows platform?.if yes , how is the performance better ? please do answer this question thank u ...

Matlab 64 vs 32 bit benchmarking results (on Win XP 64 bit vs Win XP 32 bit SP2)
Recently I installed a new PC with dual boot, win XP 32 bit and win XP 64 bit. On the 32 bit OS I run 32 bit matlab, on the 64 bit OS I run 64 bit matlab. MATLAB Version 7.3.0.267 (R2006b) Intel core 2 duo 6700 @ 2.66GHz, 2GB RAM NVIDIA GeForce 7600 GS I benchmarked the systems in 2 ways (average over multiple runs): 1) with a benchmark from the file exchange MATLAB Central > File Exchange > Utilities > Miscellaneous > Benchmark http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=11984&objectType=file 2) With my own benchmark (training of neural netwo...

32 bit Matlab install on 64 bit linux -- missing 32 bit libXp.so.6 library?
I'm trying to install 32 bit Matlab on 64 bit linux I have seen the Technical Solution <http://www.mathworks.com/support/solutions/data/1-O7POO.html?1-O7POO> and some notes for fixing this problem on Fedora <http://forums.fedoraforum.org/archive/index.php/t-106502.html> However, I'm running Ubuntu 2.6.12-9-amd64-generic, and neither of these takes me all the way to a solution. I'm at the point where I can run the installer with the following: root@lanczos:/usr/local/matlab71_sv# /usr/local/install/install_unix.sh -glnx86 -t -nocp /usr/local/install/unix/install...

mex error on 64-bit Mac OS 10.6 (running 32 bit Matlab)
Hi, I have a 64 bit MacPro running Mac OS 10.6. I am running a 32 bit Matlab. I am trying to compile a mex file, and I get the following error: mex -O -I/Users/dparikh/Documents/work/NS1/imrender_v2.3/vgg -Itrw-s/ vgg_trw_bp.cxx trw-s/MRFEnergy.cpp trw-s/minimize.cpp trw-s/ordering.cpp trw-s/treeProbabilities.cpp ld: warning: in vgg_trw_bp.o, file is not of required architecture ld: warning: in MRFEnergy.o, file is not of required architecture ld: warning: in minimize.o, file is not of required architecture ld: warning: in ordering.o, file is not of required architecture ld: warning: in tree...

C++ Mex file crashes matlab on 64bit linux, but not 32 bit windows, but program runs fine outside Matlab
Hello, I have written a mex gateway function to a C++ class. If I compile this mex function on 32Bit windows using R2008a I have no problems. If I compile and run on Matlab R2011a running 64bit Scientific Linux (a version of Red Hat Enterprize Linux) matlab exits with a segfault when the mexfunction is called, although it appears to run about halfway through the program. The C++ class can be compiled and run (with a main function) outside of Matlab on both platforms with no errors. I am using Microsoft Visual C++ Express Edition on the windows machine, and gcc 4.4.5 on the Linux machine. ...

32 bit compiler on Matlab 64 bit
Can you install a 32 bit compiler on 64 bit Matlab? I need to deploy compiled code on a 64 bit machine using 64 bit Matlab to a 32 bit machine. Is there any way I can do this WITHOUT installing 32 bit Matlab on my 64 bit computer? Thanks, Saba "Saba El-Hilo" <selhilo@sfu.ca> wrote in message <j7np4m$mae$1@newscl01ah.mathworks.com>... > Can you install a 32 bit compiler on 64 bit Matlab? > I need to deploy compiled code on a 64 bit machine using 64 bit Matlab to a 32 bit machine. Is there any way I can do this WITHOUT installing 32 bit Matlab on my 64 bit comp...

Matlab 32 Bit on 64 bit OS
Dear Readers I am planning to buy a 64 bit Laptop having 64 bit Windows 7 O.S. Presently I am using Matlab R2006b 32 bit version. I want to know, 1. If I can install R2006b 32 bit on the 64 bit OS and if yes, 2. Will the compiled application, using the mcc command produce a 32 bit application, which could be deployed on my clients computer having a 32 bit WINDOWS XP OS? Thanks Vihang ...

64-bit vs. 32-bit Matlab
I am wondering if 64-bit Matlab in 64-bit OS compiles faster things? Than 32-bit Matlab in 32-bit OS if the machine is the same one!!! If no... what are the advantages that 64-bit Matlab with 64-bit OS brings us??? "Sofia Häggberg" <hd.int.assNOSPAM@gmail.com> wrote in message <idjev2$sp6$1@fred.mathworks.com>... > I am wondering if 64-bit Matlab in 64-bit OS compiles faster things? Than 32-bit Matlab in 32-bit OS if the machine is the same one!!! Generally 64-bit is slower. >If no... what are the advantages that 64-bit Matlab with 64-bit OS brings ...

32-bit Matlab on 64-bit Linux
Hi, I've some mex code(compiled by somebody else on 32-bit machines) but I currently have a 64-bit version of Matlab installed on 64-bit ubuntu. I saw this suggestion from somebody- http://www.mathworks.cn/matlabcentral/newsreader/view_thread/100595 "The fix (since you can't recompile the .mex files) is to run the x86 version of Matlab, which you can install alongside the native x86_64 version. Once you've done that, whenever you need to run your .mexglx files, start Matlab with 'matlab -glnx86'." So I decided to search if this was actually possible and I foun...

64 bit vs. 32 bit Matlab
Hi This is a question about 64 bit vs. 32 bit MATLAB . Question one: Is it possible to run 32 bit MATLAB on a 64 bit linux machine? Are there any issues? Question two: Is a student version of 64 bit MATLAB for linux available? Please let me know, thanks, dan ...

Difference between MATLAB 64-bit and 32-bit
Hi, I had to move to a different PC which happened to have Windows Vista 64-bit and MATLAB 64-bit rather than XP 32-bit. (MATLAB R209b in both cases.) I was surprised to see my simulation results change slightly. Does this surprise anyone else? I checked that I had moved the same model and input data files correctly but obviously it is always possible that I've done something stupid! Large parts of the model use integer or fi math and most of the floating point is single precision. Any comments greatly appreciated, Matt Hi Matt, Could you provide some code snippets ...

Web resources about - create 32 bit mex files from 64 bit matlab? - comp.soft-sys.matlab

Undocumented Matlab
Undocumented, unsupported and hidden features in Matlab

MATLAB - Wikipedia, the free encyclopedia
MATLAB ( mat rix lab oratory) is a numerical computing environment and fourth-generation programming language . Developed by MathWorks , MATLAB ...

Open Directory - Science: Math: Software: MATLAB
about dmoz - help Top : Science : Math : Software : MATLAB Submit here webpages that explain and illustrate how to use MATLAB. Sites that cover ...

The Smart Emergency Response System Using MATLAB and Simulink - YouTube
In the aftermath of an earthquake, every second counts for disaster victims. Imagine a system that can locate people quickly and help first responders ...

The A-Z of Programming Languages: MATLAB
What prompted the development of MATLAB?

Matlab: Invalid .NET Framework. Either the specified framework was not found or is not currently supported ...
If you are trying to compile Matlab into .Net framework, you might encounter this message, even though you have the .Net framework installed ...

Matlab edges closer to electronic design automation world
Matlab, one of the world's most widely used products for algorithmic development, has long occupied its own niche far removed from EDA and hardware ...

Can I/How do I use DMTCP with a parallel pool of MATLAB workers? · Issue #223 · dmtcp/dmtcp · GitHub
dmtcp - DMTCP: Distributed MultiThreaded CheckPointing matlab -nodisplay -r "parpool('local',4); parfor i=1:10, pause(1); fprintf('%i ',i); end; ...

Using MATLAB and SDR to Reverse Engineer 433MHz Messages
... so he focused on studying the methodology and the tools available for analyzing 433MHz RF transmission. He describes the process of using MATLAB ...

Matlab 6.5
After several years' absence, Matlab 6.5, comes back to the Mac. This is exceptionally good news for science and engineering labs with a code ...

Resources last updated: 1/31/2016 1:10:55 PM