Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

mex -setup does not see a C++ compiler

Asked by Nicole West on 5 Jul 2012

Hello, I am having trouble getting mex -setup to recognize any of the C++ compilers I have installed (Microsoft Visual C++ Express, Intel Studio 2011).

>> mex -setup Please choose your compiler for building external interface (MEX) files:

Would you like mex to locate installed compilers [y]/n? y

Select a compiler:

[0] None

What do I need to do to remedy this issue? I am using Matlab R2009a, so I am not sure the "patches" I have read about will fix my problem. Perhaps it is something more basic? Any suggestions/advice you might provide would be greatly appreciated!

0 Comments

Nicole West

Products

No products are associated with this question.

4 Answers

Answer by Ken Atwell on 5 Jul 2012

You are using R2009a, so consult its pages for compilers that were supported at the time of its release:

Visual C++ 2005 SP1 was the supported Microsoft tool chain for use with Intel C++/Fortran version 9.1 or 10.1. It sounds like the Intel and Microsoft you are trying to use all post-date the release of 2009a, sorry.

0 Comments

Ken Atwell
Answer by Albert Yam on 5 Jul 2012

If you know the path to the compiler, you can say [no] to locate installed compilers and manually give the path.

0 Comments

Albert Yam
Answer by Ryan G on 5 Jul 2012

It does not appear to be a supported compiler. See here.

Although it is fully possible you may be ok with that compiler in what you are doing in MATLAB, you may run into issues down the road.

0 Comments

Ryan G
Answer by Nicole West on 5 Jul 2012

Thanks for your response. I thought about that, but when I tried it, it seemed to insist I select from a menu (that includes none of the compilers I actually have installed). At each iteration I tried selecting none or even just selecting one of the provided defaults, but when asked for a path it rejected what I entered:

>> mex -setup Please choose your compiler for building external interface (MEX) files:

Would you like mex to locate installed compilers [y]/n? n

Select a compiler: [1] Intel C++ 9.1 (with Microsoft Visual C++ 2005 SP1 linker) [2] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 SP1 linker) [3] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 SP1 linker) [4] Microsoft Visual C++ 2005 SP1 [5] Microsoft Visual C++ 2008 Express [6] Microsoft Visual C++ 2008 SP1

[0] None

Compiler: C:\Program Files (x86)\Intel\Composer XE 2010 SP1 Please select from 0-6 Compiler: 0

mex: No compiler selected. No action taken. 

************************************************************************ Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/support/solutions/data/1-5C27B9.html?solution=1-5C27B9 Building with the -largeArrayDims option enables the new API. ************************************************************************

Selecting none cancels the action, selecting another menu option brings this message:

The default location for Microsoft Visual C++ 2008 SP1 compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0, but that directory does not exist on this machine.

I am getting the sense that I am not adequately telling it where to look, but I unsure how/where to fix the problem.

Thanks again!

0 Comments

Nicole West

Contact us