Author Topic: How to compile a Matlab/Simulink C-File  (Read 6364 times)

Offline BennM

  • Single posting newcomer
  • *
  • Posts: 9
How to compile a Matlab/Simulink C-File
« on: April 01, 2008, 10:28:35 am »
Hi,

is there any opportunity to compile a c-file in Codeblocks für Matlab/Simulink (mexw32-File)?


Greetings: BennM

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: How to compile a Matlab/Simulink C-File
« Reply #1 on: April 01, 2008, 10:59:48 am »
is there any opportunity to compile a c-file in Codeblocks für Matlab/Simulink (mexw32-File)?
Yes, there is in principle. I have integrated the LCC compiler (that ships with Matlab, but also the stand-alone version) with C::B. In addition I have implemented a Matlab C-S-Function wizard. All is working properly but I haven't asked the big boss whether I should submit or not.

There is one major drawback: The LCC compiler queries user input under certain circumstances. Although this won't happen if properly installed,  the core compiler plugin cannot handle such user input queries. Thus C::B freezes if this happens. Notice that this only applies to LCC thus I haven't committed yet.

Yiannis: Should we discussion this again...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: How to compile a Matlab/Simulink C-File
« Reply #2 on: April 01, 2008, 11:02:00 am »
Oh: BTW: You can create MEX function using GCC, too. This works in Windows and Linux, hence under Windows it's not an officially supported compiler (by Mathworks), so it might have bad side-effects. Anyways - all my MEX functions are GCC compiled and work very well.

The wizard can handle both... probably I'll start by committing just the wizard.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BennM

  • Single posting newcomer
  • *
  • Posts: 9
Re: How to compile a Matlab/Simulink C-File
« Reply #3 on: April 01, 2008, 11:58:11 am »
I am using the Free Commandline Borland Compiler!