Unable to set up C++ compiler

21 次查看(过去 30 天)
Annamalai
Annamalai 2024-10-1
编辑: nick 2024-10-3
Hello,
I've been trying for so long to set up the required addons to run my code in MATLAB GPU. I had to install and configure various addons for the same, one such is C++ compiler. I installed MinGW64 and placed it in varous locations in my computer and run the coder.checkGpuInstall(full). Matlab isn't recognising MinGW 64 at all. I've also tried changing the directory address.
Someone please help me with it...
  3 个评论
Walter Roberson
Walter Roberson 2024-10-2
You do not indicate which MATLAB release this is for.
MATLAB R2023a generally supports VS2022, but does not support VS2022 for GPU compilation.
Your symptoms are in line with the possibility that you are running R2023a.

请先登录,再进行评论。

回答(1 个)

nick
nick 2024-10-1
Hi Annamalai,
I understand from your query that MinGW64 is not recognized in MATLAB command window. Please make sure that the version of MinGW-w64 installed on the system is compatible with version of MATLAB. You can check MATLAB's supported compilers in the following documentation :
After ensuring that the bin directory of the MinGW-w64 installation is added to the system PATH environment variable, kindly open a new MATLAB session. You can use the following command to display information about the available compiler for C++ for building MEX files:
mex -setup C++ -v
If MinGW64 is shown as an available compiler in the list, you can use the 'lang' option to change the default compiler for C++.
Aternatively, MATLAB provides an add-on for MinGW-w64, 'MATLAB Support for MinGW-w64 C/C++/Fortran Compiler', which can be installed through the Add-On Explorer. To open the Add-On Explorer, navigate to the Home tab. In the Environment section, click the Add-Ons icon. You can refer the following documentation to know more about the add-on :
  2 个评论
Annamalai
Annamalai 2024-10-2
编辑:Annamalai 2024-10-2
Here is the result of this code mex -setup C++ -v: It has found the MinGW 64 in my computer but when i run the Check, it fails again.
nick
nick 2024-10-3
编辑:nick 2024-10-3
The function 'coder.checkGpuInstall' is part of the product 'GPU Coder'. Kindly use the following documentation to identify the compatible C++ compiler with GPU Coder for the MATLAB release installed on your system:
For example, according to this documentation for GPU Coder in MATLAB R2024b, Microsoft Visual C++ 2022, not MinGW, is the supported C++ compiler.

请先登录,再进行评论。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by