Why do I get a compiler error when compiling Embedded MATLAB code for a fixed-point FFT or IFFT System Object from the Signal Processing Blockset 7.0 (R2010a)?

2 views (last 30 days)
The following error message occurs when running emlmex or emlc to compile Embedded MATLAB code for a fixed-point FFT or IFFT system object, using the 64-bit Microsoft Visual C++ 2005 compiler:
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.762 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
<filename>.c
<fullpath>\<filename.c>(line #) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'F:\qfe\vctools\compiler\utc\src\P2\main.c[0x0000000010F01A30:0x0000000000000050]', line 182)
To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Internal Compiler Error in C:\Program Files (x86)\Microsoft Visual Studio 8\VC\BIN\amd64\cl.exe. You will be prompted to send an error report to Microsoft later.
INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 8\VC\BIN\amd64\cl.exe'
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Mar 2010
To avoid this issue, select Microsoft Visual C++ 2008 as your compiler.
To work around the problem in Microsoft Visual C++ 2005, use one of the following methods:
1. Add the -g flag to compile in debug mode:
emlmex -g filename.c
emlc -g filename.c
This technique works for both emlc and emlmex, but compiling in debug mode disables all optimizations, which can reduce performance.
2. If the problem occurs when building one of the RTW targets, specify an emlcoder.RTWConfig object with '/Ob1' in the RTWCustomCompilerOptimizations:
opts = emlcoder.RTWConfig('grt')
opts.RTWCustomCompilerOptimizations = '/Ob1'
emlc -s opts -T RTW filename.c
3. Before creating a MEX target with either emlmex or emlc, edit the MEXOPTS file:
edit(fullfile(prefdir, 'mexopts.bat'))
Add /Ob1 at the end of the line that begins with 'set OPTIMFLAGS=', and save the file. The change applies to all subsequent mex file compilations. Running mex -setup will overwrite the modified mexopts.bat file.
Compiler switch /Ob1, documented at http://msdn.microsoft.com/en-us/library/47238hez(VS.80).aspx, disables the auto-inlining optimization that causes the internal compiler error.

More Answers (0)

Categories

Find more on COM Component 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!