Change the default compiler from lcc to MSVS running in Rapid accelerator mode

458 views Asked by At

I am trying to run a Simulink file which contain S-functions along with other Simulink blocks in rapid accelerator mode. When tried to build the executable I am getting a error to change the compiler from LCC to supported compilers.

Note: Matlab documentation suggests lcc compilers are incompatible with S-functions

Steps tried:

Running mex -setup I was able to select MSVS compiler already installed in my computer. But again while trying to build for rapid accelerator target, Simulink is taking LCC compiler pre-installed with its installation.

Can anyone suggest a work-around, what I am expecting is:

-Ways to change the default compiler (LCC) to another compiler preferably MSVS (installed) for building Rapid Acceleration target -Ways of overriding the LCC selection by Simulink to another compiler selection.

1

There are 1 answers

0
Akhil Nandan On

Background:The default compiler for C++ in Simulink is lcc which is packaged with the installation. According to Supported compilers in matlab it is observed that lcc doesn't S-functions and have to select another compiler installed in the system. In my case MSVS2015 satisfied all my model requirements.

To change the default compiler run

mex -setup c and mex -setup c++ to change the C and C++ compilers.

Solution:For my above question I had forgot to set C++ compiler and only changed C compiler to MSVS which caused the erroneous runs.