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

2 views (last 30 days)
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)

Kaustubha Govind
Kaustubha Govind on 1 Feb 2012
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
Rich
Rich on 1 Feb 2012
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.


Ken Atwell
Ken Atwell on 1 Feb 2012
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
Rich
Rich on 6 Feb 2012
-------------------------------------------------------------------
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. :(
Walter Roberson
Walter Roberson on 6 Feb 2012
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 C Shared Library Integration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!