Troubleshooting Custom Toolchain Validation

Build Tool Command Path Incorrect

If the path or command file name are not correct, validation displays:

Cannot find file 'path+command'. The file does not exist.

Consider the following two lines from an example toolchain definition file:

tool.setCommand('abc');
tool.setPath('/toolchain/');
To correct this issue:

  • Check that the build tool is installed.

  • Review the arguments given for the tool.setCommand and tool.setPath lines in toolchain definition file.

Build Tool Not in System Path

When the build tool’s path is not provided and the command file is not in the system path, validation displays:

Cannot find 'command'. It is not in the system path.

Consider the following two lines from an example toolchain definition file:

tool.setCommand('icl');
tool.setPath('');

Because the argument for setPath() is '' instead of an absolute path, the build tool must be on the system path.

To correct this issue:

  • Use coder.make.ToolchainInfo.ShellSetup property to add the path to the toolchain installation.

  • Use your system setup to add the toolchain installation directory to system environment path.

Otherwise, replace '' with the absolute path of the command file.

Tool Path Does Not Exist

If the path of the build tool path is provided, but does not exist, validation displays:

Path 'toolpath' does not exist.

To correct this issue:

  • Check the actual path of the build tool. Then, update the value of coder.make.BuildTool.setPath in the toolchain definition file.

  • Use your system setup to add the toolchain installation directory to system environment path. Then, set the value of coder.make.BuildTool.setPath to ''.

Path Incompatible with Builder or Build Tool

If the file separator character in the build tool path (for example '/' or '\') is not compatible with the builder application, validation can display:

Path 'toolpath' does not exist.

To correct this issue, check that the file separators in the toolchain definition match the 'FileSeparator' accepted by the tc.BuilderApplication when the specified path is used by the make file. Then, update the value of coder.make.BuildTool.setPath in the toolchain definition file.

Most toolchains and build tools (LCC being a notable exception) recognize '/' as a file separator. To get your custom toolchain definitions to behave as expected, try using '/' as the file separator.

Unsupported Platform

If the toolchain is not supported on the host computer platform, validation displays:

Toolchain 'tlchn' is supported on a 'pltfrma' platform. However, you are running on a 'pltfrmb' platform.

To correct this issue:

  • Check the coder.make.ToolchainInfo.Platform property in your toolchain definition file for errors.

  • Update or replace the toolchain definition file with one that supports your host computer platform.

  • Change host computer platforms.

Toolchain is Not installed

If the toolchain is not installed, validation displays:

Toolchain is not installed

To correct this issue, install the expected toolchain, or verify that you selected the correct toolchain, as described in Use the Custom Toolchain.

Project or Configuration Is Using the Template Makefile

By default, MATLAB® Coder™ tries to use the selected build toolchain to build the generated code. However, if the makefile configuration options detailed in the following sections are not set to their default value, MATLAB Coder cannot use the toolchain and reverts to using the template makefile approach for building the generated code.

Note

Support for template makefiles (TMF) will be removed in a future release.

MATLAB Coder Project Settings

Project Settings Dialog Box All Settings Parameter NameDefault Setting
Generate makefileYes
Make commandmake_rtw
Template makefiledefault_tmf
Compiler optimization levelOff

Command-line Configuration Parameters for the codegen function

coder.CodeConfig or coder.EmbeddedCodeConfig Parameter NameDefault Value
GenerateMakefile'true'
MakeCommand'make_rtw'
TemplateMakefile'default_tmf'
CCompilerOptimization'Off'

To use the toolchain approach, reset your configuration options to these default values manually or:

  • To reset settings for project project_name, at the MATLAB command line, enter:

    coder.make.upgradeMATLABCoderProject(project_name)

  • To reset command-line settings for configuration object config, create an updated configuration object new_config and then use new_config with the codegen function in subsequent builds. At the MATLAB command line, enter:

    new_config = coder.make.upgradeCoderConfigObject(config);

Skipped Validation of Build Tool “Download” or “Execute”

Even though the Validation Report states “Toolchain Validation Result: Passed” it includes one or both of the following notes:

### Validation of build tool "Download"
Skipped. No "Download" build tool is specified.
### Validation of build tool "Execute"
Skipped. "Execute" build tool "$(PRODUCT)" cannot be validated.

To correct this issue, update the toolchain definition file and re-register the updated toolchain. For more information, see: