Mex compiler MinGW64 only, although msvcpp xmls are in the mexopts folder

Hi,
I am having issues - for whatever reason my previous GPU compile for VS studio 2019 and Matlab 2022a got corrupted and now VS studio no longer offers VS 2019 download.
My exact issue is that the mex -setup C++ only finds MinGW64 and not the VS studio code (msvc2022) although it is in the mexopts folder and VS studio 2022 is download (including the manual C++ library installation).
Mathworks has xmls but it seems mex is not robust enough to find them and does not allow for manual addition of compilers (even though the xmls are thoroughly there in \win64 folder. Does anyone have any ideas how to compile VS studio 2022 with whatever version of MATLAB that works with it.

9 Comments

I ultimately fixed this by finding an old version of VS studio 2019. But why does mathworks not have a more robust mex? GPU's are never more relevant than now and therefore would think that mathworks first thing would be to make sure every version of MATLAB is compatible with a 2-3 year old VS studio. Or at least allow mex to all for more control of setting up a compiler.

If you are trying to compile CUDA code you should be using mexcuda.

Mex cuda still having the same issue with VS studio 2022.
but not when I use VS studio code 2019, so seems problem persists with mex cuda.
If MATLAB cannot detect VS2022 it must be a fault in the installation, since MATLAB is looking for certain registry entries to detect successful installation. Have you tried reinstalling and/or perhaps uninstalling VS19 first?
You mention VS Code - CUDA does not support this on Windows and I don't think MEX does either, so make sure it's Visual Studio and not Visual Code you have installed
It is Visual Studio. I see the staff on your page - I think its MATLAB's error. I reinstalled multiple times. I can promise you I am competent enough to correctly download the VS Studio and not VS code and to make sure it is downloaded properly.
Have you thought that maybe MATHWORKS is 2+ years behind on GPU related infrastructure?
Also shows that when I downloaded VS studio 2019 it worked, which shows that it is a MATLAB error. Nothing changed except the version of VS. Then MATLAB could find the xml. I think perhaps Mathworks is seriously behind the ball with GPU's, which is alarming given the tensor/pytorch world that exists in Python - I would be making sure something like compiling a GPU works with the most recent VS Studio.
Apologies, no intention to impugn your competence. I'm not sure what your problem has to do with GPU. It seems to be just about whether MEX is succeeding in detecting your VS2022 installation. Can you provide the -v verbose output of mexcuda so we can see why it's not detecting your install?

Sign in to comment.

Answers (0)

Products

Release

R2023a

Asked:

on 9 Aug 2024

Commented:

on 16 Aug 2024

Community Treasure Hunt

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

Start Hunting!