<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262164</link>
    <title>MATLAB Central Newsreader - create 32 bit mex files from 64 bit matlab?</title>
    <description>Feed for thread: create 32 bit mex files from 64 bit matlab?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 02 Oct 2009 13:49:04 -0400</pubDate>
      <title>create 32 bit mex files from 64 bit matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262164#684230</link>
      <author>Sriram Swaminarayan</author>
      <description>platform: osx, intel&lt;br&gt;
matlab: 7.9.0.529 (R2009b), 64-bit (maci64), August 12, 2009&lt;br&gt;
&lt;br&gt;
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.  &lt;br&gt;
&lt;br&gt;
Even if I use 'mex -arch maci ', it still only creates '.mexmaci64' files.&lt;br&gt;
&lt;br&gt;
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?&lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
Sriram</description>
    </item>
    <item>
      <pubDate>Tue, 06 Oct 2009 15:52:41 -0400</pubDate>
      <title>Re: create 32 bit mex files from 64 bit matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262164#685087</link>
      <author>Dan Hensley</author>
      <description>Sriram Swaminarayan wrote, On 10/2/2009 7:49 AM:&lt;br&gt;
&amp;gt; platform: osx, intel&lt;br&gt;
&amp;gt; matlab: 7.9.0.529 (R2009b), 64-bit (maci64), August 12, 2009&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Even if I use 'mex -arch maci ', it still only creates '.mexmaci64' files.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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?&lt;br&gt;
&lt;br&gt;
The latter.  The mex file needs to link against the appropriate 32bit &lt;br&gt;
Matlab libraries, which are only available with the 32bit installation.&lt;br&gt;
&lt;br&gt;
Dan</description>
    </item>
    <item>
      <pubDate>Tue, 06 Oct 2009 16:06:42 -0400</pubDate>
      <title>Re: create 32 bit mex files from 64 bit matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262164#685093</link>
      <author>Rune Allnor</author>
      <description>On 2 Okt, 15:49, &quot;Sriram Swaminarayan&quot; &amp;lt;sri...@lanl.gov&amp;gt; wrote:&lt;br&gt;
&amp;gt; platform: osx, intel&lt;br&gt;
&amp;gt; matlab: 7.9.0.529 (R2009b), 64-bit (maci64), August 12, 2009&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 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. &#160;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Even if I use 'mex -arch maci ', it still only creates '.mexmaci64' files.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 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?&lt;br&gt;
&lt;br&gt;
It depends on the compiler, which needs to be able to&lt;br&gt;
produce both 32-bit and 64-bit dlls and executables.&lt;br&gt;
Once you have such a compiler (not all compilers can&lt;br&gt;
do this), you will need to trick matlab/MEX to call the&lt;br&gt;
compiler in 32-bit mode instead of 64-bit mode. Which&lt;br&gt;
may or may not be possible.&lt;br&gt;
&lt;br&gt;
Last, you might need to use matlab in 32-bit mode in&lt;br&gt;
order to test the MEX file.&lt;br&gt;
&lt;br&gt;
It might be most convenient to install a 32-bit&lt;br&gt;
version of matlab on your 64-bit system, and do all&lt;br&gt;
the 32-bit mex stuff under this version.&lt;br&gt;
&lt;br&gt;
Provided, of course, that a 64-bit and a 32-bit matlab&lt;br&gt;
can coexist on your system. Which may or may ot be the case.&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
    <item>
      <pubDate>Tue, 06 Oct 2009 16:36:20 -0400</pubDate>
      <title>Re: create 32 bit mex files from 64 bit matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262164#685100</link>
      <author>Bruno Luong</author>
      <description>Dan Hensley &amp;lt;somewhere@over.there.invalid&amp;gt; wrote in message &amp;lt;hafp2q$dj4$1@news.eternal-september.org&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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?&lt;br&gt;
&lt;br&gt;
I echo Dan here: you need to keep the 32-bit version of Matlab and compile with it.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Tue, 06 Oct 2009 18:36:52 -0400</pubDate>
      <title>Re: create 32 bit mex files from 64 bit matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262164#685139</link>
      <author>Brian Arnold</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
Installing both maci and maci64 together on a Mac is supported, but &lt;br&gt;
cross-compiling a different architecture is not supported, and not &lt;br&gt;
advised.  You should always run the same architecture that you compile, &lt;br&gt;
so that you can test that what you compiled works.&lt;br&gt;
&lt;br&gt;
If you have both architectures installed, you can control the MATLAB &lt;br&gt;
architecture to run using the &quot;Open in 32-bit Mode&quot; checkbox in the Get &lt;br&gt;
Info window for the MATLAB_R2009b application in the Finder.  To specify &lt;br&gt;
the architecture from Terminal or xterm, use 'matlab -maci' or 'matlab &lt;br&gt;
-maci64'.&lt;br&gt;
&lt;br&gt;
With that said, it is actually possible to cross-compile :-). You only &lt;br&gt;
need both maci and maci64 installed, and 64-bit hardware.&lt;br&gt;
&lt;br&gt;
The environment variable MACI64 can be used to control the architecture &lt;br&gt;
that the mex, mcc and matlab shell scripts default to. To change MEX to &lt;br&gt;
compile 32-bit mexmaci from 64-bit MATLAB, set the MACI64 environment &lt;br&gt;
variable to 0 before compiling with MEX. To change it back to compiling &lt;br&gt;
64-bit mexmaci64, set it to something other than 0.&lt;br&gt;
&lt;br&gt;
Doing this has many hazards associated with it, so it's not supported, &lt;br&gt;
and my advice is that you always run the architecture you intend to &lt;br&gt;
compile, so that you can test your compiled code.&lt;br&gt;
&lt;br&gt;
Good luck,&lt;br&gt;
&lt;br&gt;
- Brian&lt;br&gt;
&lt;br&gt;
Rune Allnor wrote:&lt;br&gt;
&amp;gt; On 2 Okt, 15:49, &quot;Sriram Swaminarayan&quot; &amp;lt;sri...@lanl.gov&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; platform: osx, intel&lt;br&gt;
&amp;gt;&amp;gt; matlab: 7.9.0.529 (R2009b), 64-bit (maci64), August 12, 2009&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; 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.  &lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Even if I use 'mex -arch maci ', it still only creates '.mexmaci64' files.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; 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?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It depends on the compiler, which needs to be able to&lt;br&gt;
&amp;gt; produce both 32-bit and 64-bit dlls and executables.&lt;br&gt;
&amp;gt; Once you have such a compiler (not all compilers can&lt;br&gt;
&amp;gt; do this), you will need to trick matlab/MEX to call the&lt;br&gt;
&amp;gt; compiler in 32-bit mode instead of 64-bit mode. Which&lt;br&gt;
&amp;gt; may or may not be possible.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Last, you might need to use matlab in 32-bit mode in&lt;br&gt;
&amp;gt; order to test the MEX file.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It might be most convenient to install a 32-bit&lt;br&gt;
&amp;gt; version of matlab on your 64-bit system, and do all&lt;br&gt;
&amp;gt; the 32-bit mex stuff under this version.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Provided, of course, that a 64-bit and a 32-bit matlab&lt;br&gt;
&amp;gt; can coexist on your system. Which may or may ot be the case.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Rune</description>
    </item>
  </channel>
</rss>

