Skip to Main Content Skip to Search
Product Documentation

Setting Up File Infrastructure and Paths

Compile Path Search Order

fiaccel resolves function calls by searching first on the code generation path and then on the MATLAB path. By default, fiaccel tries to compile and generate code for functions it finds on the path unless you explicitly declare the function to be extrinsic. An extrinsic function is a function on the MATLAB path that is dispatched to MATLAB software for execution. fiaccel does not compile extrinsic functions, but rather dispatches them to MATLAB for execution.

When to Use the Code Generation Path

Use the code generation path to override a MATLAB function with a customized version. Because fiaccel searches the code generation path first, a MATLAB file on that path always shadows a MATLAB file of the same name on the MATLAB path.

To override a MATLAB function with a customized version:

  1. Create each version of the MATLAB function in identically named files.

  2. Add the MATLAB version to the MATLAB path.

  3. Add the customized version to the code generation path.

    See Adding Folders to Search Paths.

Add Files to the Code Generation Path

With fiaccel, you can prepend folders and files to the code generation path, as described in Adding Folders to Search Paths. By default, the code generation path contains the current folder and the toolbox functions supported for code generation.

Adding Folders to Search Paths

To add folders to: Do this:
Code generation pathPrepend folders to the code generation path by using the fiaccel-I option.
MATLAB pathFollow the instructions in Adding a Folder to the Search Path in the MATLAB Programming documentation.

Naming Conventions

MATLAB enforces naming conventions for functions and generated files.

Reserved Prefixes

MATLAB reserves the prefix eml for global C functions and variables in generated code. For example, run-time library function names all begin with the prefix emlrt, such as emlrtCallMATLAB. To avoid naming conflicts, do not name C functions or primary MATLAB functions with the prefix eml.

Reserved Keywords

MATLAB Coder software reserves certain words for its own use as keywords of the generated code language. MATLAB Coder keywords are reserved for use internal to MATLAB Coder software and should not be used in MATLAB code as identifiers or function names. C reserved keywords should also not be used in MATLAB code as identifiers or function names. If your MATLAB code contains any reserved keywords, the code generation build does not complete and an error message is displayed. To address this error, modify your code to use identifiers or names that are not reserved.

If you are generating C++ code using the MATLAB Coder software, in addition, your MATLAB code must not contain the C++ Reserved Keywords.

C Reserved Keywords.  

autodoubleintstruct
breakelselongswitch
caseenumregistertypedef
charexternreturnunion
constfloatshortunsigned
continueforsignedvoid
defaultgotosizeofvolatile
doifstaticwhile

C++ Reserved Keywords.  

catchfriendprotectedtry
classinlinepublictypeid
const_castmutablereinterpret_casttypename
deletenamespacestatic_castusing
dynamic_castnewtemplatevirtual
explicitoperatorthiswchar_t
exportprivatethrow 

Reserved Keywords for Code Generation.  

absfortranlocalZCErtNaN
asmHAVESTDIOlocalZCSVSeedFileBuffer
boolid_tmatrixSeedFileBufferLen
boolean_Tint_TMODELsingle
byte_Tint8_TMTTID01EQ
char_Tint16_TNCSTATEStime_T
cint8_Tint32_TNULLtrue
cint16_Tint64_TNUMSTTRUE
cint32_TINTEGER_CODEpointer_Tuint_T
creal_TLINK_DATA_BUFFER_SIZEPROFILING_ENABLEDuint8_T
creal32_TLINK_DATA_STREAMPROFILING_NUM_SAMPLESuint16_T
creal64_TlocalBreal_Tuint32_T
cuint8_TlocalCreal32_Tuint64_T
cuint16_TlocalDWorkreal64_TUNUSED_PARAMETER
cuint32_TlocalPRTUSE_RTMODEL
ERTlocalXRT_MALLOCVCAST_FLUSH_DATA
falselocalXdisrtInfvector
FALSElocalXdotrtMinusInf 

Conventions for Naming Generated files

MATLAB provides platform-specific extensions for MEX files.

PlatformMEX File Extension
Linux® (32-bit).mexglx
Linux x86-64.mexa64
Windows (32-bit).mexw32
Windows x64.mexw64

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS