MATLAB: Mex -setup OK but still can’t compile

MATLABmexmingwmingw64tigrewindowswindows10

Hi, I am trying to get this project running: https://github.com/CERN/TIGRE
I have MATLAB R2018b, and I have installed MinGW-w64 support through this add on: https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c-compiler
Running "mex -setup" for both C or C++ seems to work, with output: "MEX configured to use 'MinGW64 Compiler (C)' for C language compilation. …"
The command "getenv('MW_MINGW64_LOC')" returns correctly: 'C:\ProgramData\MATLAB\SupportPackages\R2018b\3P.instrset\mingw_w64.instrset'
The github installation steps are just to install MATLAB, install CUDA, install a MEX compiler, and run the "Compile.m" file.
CUDA seems to be correctly installed, the command "getenv('CUDA_PATH')" returns correctly: "'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0'"
However when running the "Compile.m" file, the following error happens:
Untitled.png
It seems as if "mex -setup" finds MinGW correctly but when trying to compile it fails.
I am running MATLAB in Windows 10, as Administrator.
Any ideas? Thanks!

Best Answer

You mex -setup for C but not for C++
However you mention the instructions are to install CUDA. If you are going to be trying to compile programs that use the GPU then you cannot use MinGW. See https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/system-requirements-release-2018b-supported-compilers.pdf and notice that GPU coder does not support MinGW.