MATLAB: Do I receive an error about a missing reference to DGEMM32 library when using the MAKE command for C code generated from MATLAB code in Real-Time Workshop 7.6 (R2010)

matlab coder

I am generating C code from my MATLAB code using EMLC. Along with my custom code and the generated C code, I would like to use the MAKE command to create an executable on my Windows 7 (64 bit) machine. I have written a MAKE file that can accomplish this task. When executing the MAKE command at the DOS prompt for the aforesaid C files, I receive the following error message:
%FILEPATH%: undefined reference to `dgemm32' collect2: ld returned 1 exit status make: *** [42] Error 1
where FILEPATH refers to the object file for the C code "foo.o" that is generated from my MATLAB code "foo.m"

Best Answer

DGEMM32 is a BLAS call. We don't generate BLAS calls yet for Real-Time Workshop targets of any kind, let alone embedded targets. In this case since you are using the EMLC to generate code for MEX, the solution is to generate code using "-T RTW:LIB" option for the EMLC construct. Using the mentioned option, you can create a library using the generated code files for a specific target and use them in along with the other custom C files.
The steps to use the MAKE function will be the following:
1. Use the EMLC -T RTW:LIB option to create a target specific library using the generated C code files that for the MATLAB code.
2. Use the MAKE comamnd to create an executable using the created library in step 1 and other C files.
You can find more information about this option by executing the following command at MATLAB command prompt:
doc emlc