Create Polyspace Projects from Build Systems That Use Unsupported Compilers
Issue
Your compiler is not supported for automatic project creation from build commands.
Cause
For automatic project creation from your build system, your compiler configuration must be available to Polyspace®. Polyspace provides a compiler configuration file only for certain compilers.
For information on which compilers are supported, see Requirements for Project Creation from Build Systems.
Solution
To enable automatic project creation for an unsupported compiler, you can write your own compiler configuration file.
Copy one of the existing configuration files from
. Select the configuration that most closely corresponds to your compiler using the mapping between the configuration files and compiler names.polyspaceroot
\polyspace\configure\compiler_configuration\Save the file as
.my_compiler
.xmlmy_compiler
can be a name that helps you identify the file.To edit the file, save it outside the installation folder. After you have finished editing, you must copy the file back to
.polyspaceroot
\polyspace\configure\compiler_configuration\Edit the contents of the file to represent your compiler. Replace the entries between the XML elements with appropriate content.
After saving the edited XML file to
, create a project automatically using your build command.polyspaceroot
\polyspace\configure\compiler_configuration\If you see errors, for instance, compilation errors, contact MathWorks® Technical Support. After tracing your build command, the software compiles certain files using the compiler specifications detected from your configuration file and build command. Compilation errors might indicate issues in the configuration file.
Tip
To quickly see if your compiler configuration file works, run the automatic project setup on a sample build that does not take much time to complete. After you have set up a project with your compiler configuration file, you can use this file for larger builds.
Elements of Compiler Configuration File
The following table lists the XML elements in the compiler configuration file file with a description of what the content within the element represents.
XML Element | Content Description | Content Example for GNU® C Compiler |
---|---|---|
<compiler_names><name> ...
</name><compiler_names> |
Name of the compiler executable. This executable
transforms your You must not specify the linker binary inside the
If the name that you specify is present in an existing
compiler configuration file, an error occurs. To avoid the
error, use the additional option |
|
<include_options><opt> ...
</opt></include_options> |
The option that you use with your compiler to specify include folders. To specify options where the argument immediately follows
the option, use an | -I |
<system_include_options><opt> ...
</opt></system_include_options> |
The option that you use with your compiler to specify system headers. To specify options where the argument immediately follows
the option, use an | -isystem |
<preinclude_options><opt> ...
</opt></preinclude_options> |
The option that you use with your compiler to force inclusion of a file in the compiled object. To specify options where the argument immediately follows
the option, use an | -include |
<define_options><opt> ...
</opt></define_options> |
The option that you use with your compiler to predefine a macro. To specify options where the argument immediately follows
the option, use an | -D |
<undefine_options><opt> ...
</opt></undefine_options> |
The option that you use with your compiler to undo previous definitions of a macro. To specify options where the argument immediately follows
the option, use an | -U |
<semantic_options><opt> ...
</opt></semantic_options> |
The options that you use to modify the compiler behavior. These options specify the language settings to which the code must conform. You can use the
|
|
<compiler> ...
</compiler> | The Polyspace compiler option that corresponds to or closely matches your compiler. The content of this element directly translates to the option Compiler in your Polyspace project or options file. For the
complete list of compilers available, see | gnu4.7 |
<compile_options_list><opt> ...
</opt></compile_options_list> | The options that you use to compile source files without linking. | -c |
<preprocess_options_list><opt> ...
</opt></preprocess_options_list> |
The options that specify how your compiler generates a preprocessed file. You can use the macro |
For an example of the |
<preprocessed_output_file> ...
</preprocessed_output_file> |
The name of file where the preprocessed output is stored. You can use the following macros when the name of the preprocessed output file is adapted from the source file:
For instance, use
| For an example of this element, see the existing compiler configuration file |
<src_extensions><ext> ...
</ext></src_extensions> | The file extensions for source files. |
|
<obj_extensions><ext> ...
</ext></obj_extensions> | The file extensions for object files. | o |
<precompiled_header_extensions> ...
</precompiled_header_extensions> | The file extensions for precompiled headers (if available). | gch |
<polyspace_extra_options_list> <opt> ... </opt> <opt> ... </opt> </polyspace_extra_options_list> | Additional options that are used for the subsequent analysis. For instance, to avoid compilation
errors in the subsequent analysis due to non-ANSI® extension keywords, enter <polyspace_extra_options_list> <opt>-D MACRO1</opt> <opt>-D MACRO2=VALUE</opt> </polyspace_extra_options_list> For
more information, see |
Mapping Between Existing Configuration Files and Compiler Names
Select the configuration file in
that most closely resembles the configuration of your compiler. Use the following
table to map compilers to their configuration files.polyspaceroot
\polyspace\configure\compiler_configuration\
Compiler Name | Vendor | XML File |
---|---|---|
ARM® | ARM Keil | armcc.xml |
armclang.xml | ||
Visual C++® | Microsoft® | cl.xml |
Clang | Not applicable | clang.xml |
CodeWarrior® | NXP | cw_ppc.xml |
cw_s12z.xml | ||
cx6808 | Cosmic | cx6808.xml |
cosmic.xml | ||
Diab | Wind River® | diab.xml |
gcc | Not applicable | gcc.xml |
Green Hills® | Green Hills Software | ghs_arm.xml |
ghs_arm64.xml | ||
ghs_i386.xml | ||
ghs_ppc.xml | ||
ghs_rh850.xml | ||
ghs_tricore.xml | ||
IAR Embedded Workbench | IAR | iar.xml |
iar-arm.xml | ||
iar-avr.xml | ||
iar-msp430.xml | ||
iar-rh850.xml | ||
iar-riscv.xml | ||
iar-rl78.xml | ||
Renesas® | Renesas | renesas-rh850.xml |
renesas-rl78.xml | ||
renesas-rx.xml | ||
renesas-sh.xml | ||
TASKING® | Altium® | tasking.xml |
tasking-166.xml | ||
tasking-850.xml | ||
tasking-arm.xml | ||
Tiny C | Not applicable | tcc.xml |
TM320 and its derivatives | Texas Instruments® | ti_arm.xml |
ti_c28x.xml | ||
ti_c6000.xml | ||
ti_msp430.xml | ||
xc8 (PIC) | Microchip | microchip.xml |