How can one get a 32 bit compiler environment with 64bit Matlab and Simulink Coder?

조회 수: 5 (최근 30일)
Hello,
I'm trying to write a template makefile that will produce 32-bit binaries on a 64 bit installation of Matlab. So far, I simply set CPU = i386 in the .tmf file, but it still tries to produce a 64-bit binary. I could also narrow down the problem to the compiler environment set up in the modelname.bat file (which is generated automatically).
Basically, Matlab 64 bit writes the first line as:
call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" AMD64
and the only thing I need to do is remove AMD64 to make it work (but editing by hand is not an option since the whole thing should work by pushing the "Build" button inside Simulink).
So how can I get the Simulink Coder to omit this AMD64 in the generated .bat file???
Is there a specific value for COMPILER_TOOL_CHAIN that I can use in the TMF file? It seems that COMPILER_TOOL_CHAIN = vc implies AMD64 on a 64bit installation of Matlab...
Thanks in advance for any help on this subject!
Fritz Menzer

채택된 답변

Fritz Menzer
Fritz Menzer 2012년 7월 18일
We solved the problem by implementing a STF_wrap_make_cmd_hook.m function and different (appropriately modified) "setup_for_visual" functions, one for each supported Matlab release (our STF_wrap_make_cmd_hook.m function just checks the Matlab version and calls the corresponding setup_for_visual.m function).
For more information, refer to the "Key Files in the Target Folder" page of the Matlab documentation and have a look at the setup_for_visual.m file which is in the toolbox/rtw/rtw folder of your Matlab installation.
  댓글 수: 1
Wojciech Przystas
Wojciech Przystas 2013년 6월 13일
This solution unfortunately does not work with the (free) Microsoft Windows SDK 7.1 compiler. Does anyone got a suitable solution?
Thanks.

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

추가 답변 (1개)

Zhen Gang
Zhen Gang 2012년 7월 12일
I removed the "AMD64" manually, then run the "bat" file again, and a 32-bit dll was generated.
  댓글 수: 1
Fritz Menzer
Fritz Menzer 2012년 7월 18일
Well, I was hoping that I could avoid getting the AMD64 string in the first place or that there was a way to automate the modification of the .bat file... Manual editing is not an option unfortunately. We did find a way to solve the general problem of generating 32-bit binaries though (but that way needs to be adapted to each version of Matlab/Simulink...). I'll put an answer relating to it shortly.

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

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by