How do you produce win32 exes with deploytool in 64-Bit Matlab

MATLAB Version: 8.1.0.604 (R2013a)
I am using the Matlab compiler on a 64-bit and I need to be able to produce x32 compatible versions of the executables for people on older windows machines. How do I do this? I see several confusing suggestions about using -win32 flags, having to have both 64-bit and 32-bit versions of Matlab installed, etc. I assume there is an easier way of doing this?

 채택된 답변

Andreas Goser
Andreas Goser 2014년 1월 17일
From
doc 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).
What do you think is confusing or can be easier?
In general you can install the environment where you want to have an executable for and create it there. That is safe, but yes this is not so easy.

댓글 수: 3

Hi Andreas - thanks for the reply. A few things:
  • Does a 64-bit install of Matlab also install a 32-bit version of the product or do I need to do that? If it is the latter, that takes time and is error-prone. It is furthermore not obvious that one would need to do so.
  • I use the deploytool to build my exes. I don't know how to provide the mcc with the -win32 option from within that tool. There is a project settings window (see below) and, at a guess, it might be the preprocessor symbols setting but it is not clear, at least to me. Note that the round-trip time to test attempts at this is long as I have to transfer between machines. What would be easier would be an explicit option on the deploytool for win32 target machines. It should be able to determine when this option is relevant.
  • I cannot speak for other users but, for me, having to produce 32-bit versions of exe's is quite a common occurrence. I cannot predetermine the spec of the target machine. In fact, I would probably default to the -win32 option if I could work out how to use it.
1.) You would need to install the 32bit MATLAB in addition by your own, 2.) If you read the above post carfully you would have read "You are running from a Windows command line (not a MATLAB command line)." So you cannot use this -win32 from inside MATLAB.
Overall the easiest is to install a 32bit MATLAB and use that for compiling a 32bit application and completly forget about that win32 flag.
Martin, I see you have contacted Technical Support today with a subset of your questions, receiving the same answers. I suggest that you continue working with Technical Support. Probably having a phone call is helpful, as it is important to understand the larger picture.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB Compiler SDK에 대해 자세히 알아보기

질문:

2014년 1월 17일

댓글:

2014년 1월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by