Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create a 32bit standalone executable on a 64bit machine?

Tags:

matlab

mcc

I'm creating a standalone executable from MATLAB .m file using mcc. My machine is a 64bit machine and the target machine is 32bit machine, is it possible to create such an application (and to be able to run it on the target machine of course)?

like image 522
Muhammad Avatar asked Jan 30 '26 05:01

Muhammad


1 Answers

Probably the simplest way to do this is to install the 32 bit version of MATLAB and use the mcc from that installation.

Don't worry about the warnings that you get about installing 32 bit MATLAB on 64 bit Windows. It works just fine. I have lots of different versions of MATLAB installed on my machine for development purposes, both 32 and 64 bit, all happily co-existing side by side.

The documentation also mentions a -win32 option that can be passed to mcc:

-win32 Run in 32-Bit Mode

Use this option to build a 32-bit application on a 64-bit system only when the following are both true:

  • You use the same MATLAB installation root (matlabroot) for both 32-bit and 64-bit versions of MATLAB.
  • You are running from a Windows command line (not a MATLAB command line).

Since you have to install 32 bit MATLAB, no matter what, it seems to me that it's just easier to run the 32 bit mcc directly.

like image 155
David Heffernan Avatar answered Jan 31 '26 22:01

David Heffernan