R2006a 64-Bit / VC++ 2010 SDK 7.1 / Simulink / Embedded Matlab Fcn make error: lccmake

I have a simple Simulink model with an Embedded Matlab Function block that gives me the following Make error:
'"c:\program files\matlab\r2006a\sys\lcc\bin\lccmake"' is not recognized as an internal or external command, operable program or batch file.
I'm running R2006a 64-Bit with VC++ 2010 Express and SDK 7.1 installed. 'mex -setup' has been configured to work with VC++. I can mex c files from the command line without errors.
How do I get the Embedded Matlab Function to recognize that VC++ is the compiler, not lccmake? Is there something else I have to do other than 'mex -setup'?
----------------
Alternatively, all I'm trying to do is break out a single precision float to four bytes in Simulink. It can be done from the command line with typecast(x,'uint8'). If there's a Simulink function block that does this then I'll just use that instead of an Embedded Matlab Function block.

Answers (2)

Perhaps Simulink is using a stale Makefile that was generated with another version of MATLAB into the same folder? See if there is an existing 'slprj' directory and delete it, so that it is regenerated again.

1 Comment

I deleted the sfprj directory and saw it reappear when I ran the model... didn't fix it. I got the same Make error.
----
I found an m file called C:\Program Files\MATLAB\R2006a\toolbox\stateflow\coder\private\code_interface_and_support_files.m that contains some of the same wording seen in the file generation process.
I don't believe this file is used for Embedded Matlab Function blocks in Simulink. I changed some of the text strings and the changes made did not show up in the Logs shown in the Coder window. If it's not this file being used then I'm not sure which file is used. My text searches did not reveal any other *.m files with the text. There must be some other *.m file used in the Simulink file generation process.
There's a section of code in the above mentioned file that appears to be somewhat of a default case that generates files that use lcc.:
if (~isunix & gTargetInfo.codingLccMakefile & ...
~gTargetInfo.codingMSVC42Makefile & ...
~gTargetInfo.codingBorlandMakefile & ...
~gTargetInfo.codingWatcomMakefile)
if makefileCheckSumChanged | ...
~check_if_file_is_in_sync(fullfile(fileNameInfo.targetDirName,fileNameInfo.lccMakeFile),lastBuildDate)
code_lcc_make_file(fileNameInfo);
end
endSo... the gTargetInfo structure does not have settings for VC++ 2010 and therefore Simulink doesn't know what compiler to use so it just tries to use lcc.

Sign in to comment.

Are you sure you are using 64-bit R2006a with the 7.1 SDK? I ask because 6a pre-dates this SDK by a number of years, and 6a does not support it. I would be surprised to learn that "mex -setup" acknowledged this SDK at all.
See http://www.mathworks.com/support/compilers/1601_72.html for historical supported compiler information for R2006a. Visual C++ 2005 (with 64-bit tools support) is your most realistic option.

4 Comments

When I run 'computer' from the command line I get ans = PCWIN64.
After installing SDK 7.1 I ran the following from the command line:
C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup> WindowsSdkVer.exe -version:v7.1
I obtained VS2010MEXSupport.zip from:
http://www.mathworks.com/support/solutions/en/data/1-D5W493/?solution=1-D5W493
and installed it with the following command:
unzip( path_to_zip_file, matlabroot);
The output I get from 'mex -setup' is:
>> mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n?
Select a compiler:
[1] Microsoft Visual C++ 2010 Express in C:\Program Files (x86)\Microsoft Visual Studio 10.0
[0] None
Compiler: 1
Please verify your choices:
Compiler: Microsoft Visual C++ 2010 Express
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct?([y]/n):
***************************************************************************
Warning: MEX-files generated using Microsoft Visual C++ 2010 require
that Microsoft Visual Studio 2010 run-time libraries be
available on the computer they are run on.
If you plan to redistribute your MEX-files to other MATLAB
users, be sure that they have the run-time libraries.
***************************************************************************
Trying to update options file: C:\Users\rgrisier\Application Data\MathWorks\MATLAB\R2006a\mexopts.bat
From template: C:\PROGRAM FILES\MATLAB\R2006A\BIN\win64\mexopts\msvc100freeopts.bat
Done . . .
>>
Right. But as Ken points out, that compiler is too new for your MATLAB version, and so compilations fail.
-------------------------------------------------------------------
Compilations don't fail. I'm able to compile the example file with "mex -v yprime.c" to generate the yprime.mex64 file. The problem is with the code that generates *.bat file which calls lcc by default because it doesn't know what VC++ 2010 is.
As a work-around, I've gone back to using the 32-Bit version on my old computer. :(
The bat file that calls lcc is part of the compilation process.
You could, as Ken notes, install Visual C++ 2005 with SDK 6.x and that should work (in theory)

Sign in to comment.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Asked:

on 1 Feb 2012

Edited:

on 26 Sep 2013

Community Treasure Hunt

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

Start Hunting!