Unable to set up C++ compiler

조회 수: 19 (최근 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
Annamalai
Annamalai 2024년 10월 2일
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