Specifying a registered toolchain
Show older comments
When I attempt to build my Simulink model, I receive an error that none of the toolchains specified in C:\Program Files\MATLAB\R2024a\toolbox\coder\compile\tmf\ert_unix.tmf are in the current list of registered toolchains:
Error using coder.make.internal.TMFProps/extractToolchainAttributesFromName (line 219)
None of the toolchains, "Xcode with Clang | gmake (64-bit Mac), GNU gcc/g++ | gmake (64-bit Linux)", specified
in C:\Program Files\MATLAB\R2024a\toolbox\coder\compile\tmf\ert_unix.tmf in are in the current list of
registered toolchains, "AUTOSAR Adaptive Linux Executable, AUTOSAR Adaptive | CMake, Cadence Xcelium (64-bit
Linux), Catkin, CMake, Colcon Tools, eProsima 2.x Project, IBIS-AMI GNU gcc/g++ cross-compiler source code |
gmake (64-bit Windows), IBIS-AMI GNU gcc/g++ cross-compiler | gmake (64-bit Windows), IBIS-AMI Microsoft Visual
C++ 2017 v15.0 | nmake (64-bit Windows), IBIS-AMI Microsoft Visual C++ 2019 v16.0 | nmake (64-bit Windows),
IBIS-AMI Microsoft Visual C++ 2022 v17.0 | nmake (64-bit Windows), IBIS-AMI MinGW64 | gmake (64-bit Windows),
Intel oneAPI 2021 (w/Microsoft Visual Studio 2017) | nmake (64-bit Windows), Intel oneAPI 2021 (w/Microsoft
Visual Studio 2019) | nmake (64-bit Windows), Intel oneAPI 2022 (w/Microsoft Visual Studio 2017) | nmake
(64-bit Windows), Intel oneAPI 2022 (w/Microsoft Visual Studio 2019) | nmake (64-bit Windows), Intel oneAPI
2022 (w/Microsoft Visual Studio 2022) | nmake (64-bit Windows), Intel oneAPI 2023 (w/Microsoft Visual Studio
2019) | nmake (64-bit Windows), Intel oneAPI 2023 (w/Microsoft Visual Studio 2022) | nmake (64-bit Windows),
Intel Parallel Studio XE 2020 (w/Microsoft Visual Studio 2017) | nmake (64-bit Windows), Intel Parallel Studio
XE 2020 (w/Microsoft Visual Studio 2019) | nmake (64-bit Windows), LCC-win64 v2.4.1 | gmake (64-bit Windows),
Mentor Graphics QuestaSim/Modelsim (32-bit Windows), Mentor Graphics QuestaSim/Modelsim (64-bit Linux), Mentor
Graphics QuestaSim/Modelsim (64-bit Windows), Microsoft Visual C++ 2017 v15.0 | CMake/Ninja (32-bit Windows),
Microsoft Visual C++ 2017 v15.0 | CMake/Ninja (64-bit Windows), Microsoft Visual C++ 2017 v15.0 | CMake/nmake
(32-bit Windows), Microsoft Visual C++ 2017 v15.0 | CMake/nmake (64-bit Windows), Microsoft Visual C++ 2017
v15.0 | nmake (64-bit Windows), Microsoft Visual C++ 2019 v16.0 | CMake/Ninja (32-bit Windows), Microsoft
Visual C++ 2019 v16.0 | CMake/Ninja (64-bit Windows), Microsoft Visual C++ 2019 v16.0 | CMake/nmake (32-bit
Windows), Microsoft Visual C++ 2019 v16.0 | CMake/nmake (64-bit Windows), Microsoft Visual C++ 2019 v16.0 |
nmake (64-bit Windows), Microsoft Visual C++ 2022 v17.0 | CMake/Ninja (32-bit Windows), Microsoft Visual C++
2022 v17.0 | CMake/Ninja (64-bit Windows), Microsoft Visual C++ 2022 v17.0 | CMake/nmake (32-bit Windows),
Microsoft Visual C++ 2022 v17.0 | CMake/nmake (64-bit Windows), Microsoft Visual C++ 2022 v17.0 | nmake (64-bit
Windows), Microsoft Visual Studio Project 2017 | CMake (32-bit Windows), Microsoft Visual Studio Project 2017 |
CMake (64-bit Windows), Microsoft Visual Studio Project 2019 | CMake (32-bit Windows), Microsoft Visual Studio
Project 2019 | CMake (64-bit Windows), Microsoft Visual Studio Project 2022 | CMake (32-bit Windows), Microsoft
Visual Studio Project 2022 | CMake (64-bit Windows), MinGW64 | CMake/gmake (64-bit Windows), MinGW64 |
CMake/Ninja (64-bit Windows), MinGW64 | gmake (64-bit Windows), NVIDIA CUDA (w/Microsoft Visual C++ 2017) |
nmake (64-bit Windows), NVIDIA CUDA (w/Microsoft Visual C++ 2019) | nmake (64-bit Windows), NVIDIA CUDA
(w/Microsoft Visual C++ 2022) | nmake (64-bit Windows), RTI Connext 6.x Project, RTI Connext Micro 2.4 Project,
Simulink Real-Time Linux arm64 Remote Build Toolchain, Simulink Real-Time Linux x64 Remote Build Toolchain,
Simulink Real-Time Toolchain, Synopsys VCS (64-bit Linux), Xilinx Vivado Simulator (64-bit Linux), Xilinx
Vivado Simulator (64-bit Windows)".
Error in coder.make.internal.TMFProps (line 325)
lToolchain = extractToolchainAttributesFromName...
Error in coder.make.internal.getTMFProperties (line 51)
lTMFProperties = coder.make.internal.TMFProps(lTemplateMakefile, lMexCompilerKey);
Error in coder.internal.getMexCompilerForModel
Error in coder.internal.getMexCompilerForModel
Error in coder.internal.ModelCompInfo/createModelCompInfoPrivate
Error in coder.internal.ModelCompInfo.createModelCompInfo
Error in slbuild_private
Error in slbuild_private
Error in sl_feval
Error in coder.internal.codegenAndCompile
Error in slbuild
Error in slbuild
Error in rtwbuild
My installation is set up to use MSVS 2019 to compile C code:
>> mex -setup C
Renamed options file 'C:\Users\...\AppData\Roaming\MathWorks\MATLAB\R2024a\mex_C_win64.xml' to 'C:\Users\...\AppData\Roaming\MathWorks\MATLAB\R2024a\mex_C_win64_backup.xml'.
MEX configured to use 'Microsoft Visual C++ 2019 (C)' for C language compilation.
My model configuration parameter setting for Code Generation -> Build process -> Toolchain is set to Automatically locate an installed toolchain, which I believe is required by my ert.tlc system target file setting.
What can I do to fix this error?
6 Comments
Umar
on 2 Jul 2024
Hi KK,
I can pinpoint you in the right direction.You can explicitly specify the toolchain to be used for code generation in your Simulink model configuration by following these steps: Open your Simulink model. Go to Model Configuration Parameters. Navigate to Code Generation -> Build process -> Toolchain. Instead of selecting "Automatically locate an installed toolchain," choose "Specify a toolchain" and select the appropriate toolchain (in this case, Microsoft Visual C++ 2019). Save the configuration changes.
By explicitly specifying the toolchain, you ensure that the model uses the correct toolchain for compilation, which will help resolve the error related to unrecognized toolchains.
Hope this will help resolve your issues.
Engenuity
on 2 Jul 2024
Umar
on 2 Jul 2024
Hi Engenuity,
Sorry to hear that. However, there is still hope. To overcome this limitation, consider creating a custom target file based on the ert.tlc file with the necessary modifications. By customizing the target file, you can have more control over the Code Generation settings and toolchain selection. Additionally, ensure that the custom target file is properly configured to meet your specific requirements before generating code.
Umar
on 2 Jul 2024
Also, I would like you try few things which should be able to modify the model configuration parameter setting for Code Generation even when using the ert.tlc system target file setting in Matlab. Open your Matlab model. Go to the 'Model Configuration Parameters' by clicking on 'Model' in the menu bar and selecting 'Model Settings'. In the 'Model Configuration Parameters' dialog, navigate to 'Code Generation' -> 'Build process'. Change the 'Toolchain' setting from 'Automatically locate an installed toolchain' to 'Specify a toolchain'. Select the appropriate toolchain from the dropdown menu or specify a custom toolchain path. Click 'Apply' and then 'OK' to save the changes.
Umar
on 2 Jul 2024
Sounds great, please keep me updated.
Accepted Answer
More Answers (0)
Categories
Find more on Build Configuration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!