Why do I get errors when running my model in Rapid Accelerator mode in Simulink 8.1 (R2013a)?

2 views (last 30 days)
When I try to run 'vdp' in Rapid Accelerator mode, I get the following error message in Simulink 8.1 (R2013a)?
Results of rapid accelerator compile of vdp:
### Building the rapid accelerator target for model: vdp
xcrun clang -arch x86_64 -c -o vdp.o -fno-common -fexceptions -DON_TARGET_WAIT_FOR_START=0 -DEXT_MODE -DMACI64 -DRSIM_PARAMETER_LOADING -O0 -DNDEBUG -DMODEL=vdp -DHAVESTDIO -DUNIX -DNRT -DRSIM_WITH_SL_SOLVER -I. -I../../.. -I/Applications/MATLAB_R2013a.app/simulink/include -I/Applications/MATLAB_R2013a.app/extern/include -I/Applications/MATLAB_R2013a.app/rtw/c/src -I/Applications/MATLAB_R2013a.app/rtw/c/src/rapid -I/Applications/MATLAB_R2013a.app/rtw/c/raccel -I/Applications/MATLAB_R2013a.app/rtw/c/src/ext_mode/common -I/Users/ware/obsim/lisa/slprj/raccel/vdp -I/Users/ware/obsim/lisa -I/Applications/MATLAB_R2013a.app/toolbox/simulink/simdemos/simgeneral -I/Applications/MATLAB_R2013a.app/toolbox/coder/rtiostream/src/utils "vdp.c"
vdp.c:2:10: fatal error: 'math.h' file not found
#include <math.h>
^
1 error generated.
gmake: * [vdp.o] Error 1
### Build procedure for model: 'vdp' aborted due to an error.
My System Configuration:
Version of Xcode: 4.6.3
Version of MATLAB:R2013a
Operating System: Mac OS X Version: 10.7.4 Build: 11E53
Java Version: Java 1.6.0_51-b11-457-11M4509 with Apple Inc. Java HotSpot™ 64-Bit Server VM mixed mode
How do I resolve this issue?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 24 Oct 2013
This issue arises because Xcode is not able to find the standard header files in its search path. These header files are usually obtained when GCC compiler is installed on the system.
Starting with Xcode 4.3, Command Line Tools must be manually installed to obtain GCC, LLVM compilers and MAKE utility. Please note that Command Line Tools requires Mac OS X 10.7.3 or later.
To install Command Line Tools, go to
Xcode>Preferences>Downloads>Command Line Tools>Install.
Further, the Command Line Tools do not install any SDKs. Therefore, when Simulink Coder references SDKs, it fails because it is unable to locate any header files. This can be resolved by allowing Simulink Coder to use the headers installed with Command Line Tools by removing references to SDKs that existed in previous versions of Xcode. 
In the specific case of using MAC OS 10.7.x with Xcode 4.3 it is possible to remove the lines that refer to SDKROOT or MACOSX_DEPLOYMENT_TARGET from the “unixtools.mk” file if the file matches the use-case here. “unixtools.mk” is located at:
([matlabroot,'\rtw\c\tools\unixtools.mk'])
The references to SDKROOT and MACOSX_DEPLOYMENT_TARGET can be eliminated by removing the six lines that start with “%”s from the section of “unixtools.mk” I have included bellow:
ifeq ($(COMPUTER),MACI64) 
DEFAULT_OPT_OPTS = -O0 -ffloat-store 
  1. architecture support x86_64 
ARCHS = x86_64 
LD_NAMESPACE = -twolevel_namespace 
LD_UNDEFS = -undefined error 
% SDKROOT = /Developer/SDKs/MacOSX10.6.sdk 
% MACOSX_DEPLOYMENT_TARGET = 10.5 
CC = gcc -arch $(ARCHS) 
CPP = g++ -arch $(ARCHS) 
ANSI_OPTS = \ 
% -isysroot $(SDKROOT) \ 
% -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) \ 
-fno-common -no-cpp-precomp -fexceptions 
#instead of using -bundle, use -dynamiclib flag to make the lib dlopen compatible 
SHRLIBLDFLAGS = \ 
-dynamiclib \ 
% -Wl,-syslibroot,$(SDKROOT) \ 
% -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) \ 
-Wl,$(LD_NAMESPACE) $(LD_UNDEFS) -Wl,-exported_symbols_list, 
endif
Lastly, spaces on the path are not supported on non-Windows machines. It is due to difficulties associated with make files (3rd party make tools) that have paths containing spaces, not MathWorks software. On Windows machines, the constraint is resolved by using short pathnames, but these are not available on non-Windows machines. So, also verify whether there are any spaces in the folder location from where the code generation and build is happening. Moving to a location without spaces has been seen to resolve the issue in few cases.

More Answers (0)

Categories

Find more on Manage Products in Help Center and File Exchange

Products


Release

R2013a

Community Treasure Hunt

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

Start Hunting!