Unable to set up C++ compiler

21 Ansichten (letzte 30 Tage)
Annamalai
Annamalai am 1 Okt. 2024
Bearbeitet: nick am 3 Okt. 2024
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 Kommentare
Annamalai
Annamalai am 2 Okt. 2024
Walter Roberson
Walter Roberson am 2 Okt. 2024
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

nick
nick am 1 Okt. 2024
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 Kommentare
Annamalai
Annamalai am 2 Okt. 2024
Bearbeitet: Annamalai am 2 Okt. 2024
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 am 3 Okt. 2024
Bearbeitet: nick am 3 Okt. 2024
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.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by