Precompiled Static Libraries

Simscape™ and its add-on products provide static libraries precompiled for compilers supported by Simulink® Coder™ software. For details on supported compilers, see Supported and Compatible Compilers. For all other compilers, the static libraries needed by code generated from Simscape models are compiled once per model during the code generation build process.

To save time during the build process, precompile new or updated S-function libraries (MEX-files) for a model by using the MATLAB® language function rtw_precompile_libs. You can also use the rtw_precompile_libs function to recompile a precompiled S-function library. Recompiling a precompiled library allows you to customize compiler settings for various platforms or environments. For details on using rtw_precompile_libs, see Precompile S-Function Libraries (Simulink Coder).

Typically, a target machine places cross-compiled versions of the precompiled libraries in a default location as specified in an rtwmakecfg.m file. The default file suffix and file extension used by the Simulink Coder code generator to name precompiled libraries during the build process are:

  • On Windows® systems, model_rtwlib.lib

  • On UNIX® or Linux® systems, model_rtwlib.a

You can control the file destination, location, suffix, and extension by customizing the system target file (STF) for your target hardware. For more information, see Control Library Location and Naming During Build (Simulink Coder) and Use rtwmakecfg.m API to Customize Generated Makefiles (Simulink Coder).

See Also

Related Topics