MEX Verification in MATLAB (R2008a)

Hello all,
I am trying to test MEX configuration in MATLAB (R2008a); however, it doesn't work. Now, I don't know how to fix this. Thank you for your help.
>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
Would you like mbuild to locate installed compilers [y]/n? n
Select a compiler:
[1] Microsoft Platform SDK 14.0
[2] Microsoft Visual C++ 2005
[3] Microsoft Visual C++ 2008
[0] None
Compiler: 3
The default location for Microsoft Visual C++ 2008 compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0,
but that directory does not exist on this machine.
Use C:\Program Files (x86)\Microsoft Visual Studio 9.0 anyway [y]/n? y
Please verify your choices:
Compiler: Microsoft Visual C++ 2008
Location: C:\Program Files (x86)\Microsoft Visual Studio 9.0
Are these correct [y]/n? y
****************************************************************************
Warning: Applications/components generated using Microsoft Visual Studio
2008 require that the Microsoft Visual Studio 2008 run-time
libraries be available on the computer used for deployment.
To redistribute your applications/components, be sure that the
deployment machine has these run-time libraries.
****************************************************************************
Trying to update options file: C:\Users\sor\AppData\Roaming\MathWorks\MATLAB\R2008a\compopts.bat
From template: C:\PROGRA~1\MATLAB\R2008a\bin\win64\mbuildopts\msvc90compp.bat
Done . . .
>> mex yprime.c
Error: Could not find the compiler "cl" on the DOS path.
Use mex -setup to configure your environment properly.
C:\PROGRA~1\MATLAB\R2008A\BIN\MEX.PL: Error: Unable to locate compiler.
??? Error using ==> mex at 207
Unable to complete successfully.

 Risposta accettata

Kaustubha Govind
Kaustubha Govind il 23 Lug 2012

0 voti

You need to run "mex -setup" ("mbuild -setup" is for configuring the compiler to be used with MATLAB Compiler).

5 Commenti

Nak So
Nak So il 23 Lug 2012
Kaustubha,
When I ran "mex -setup" here what I got, and I don't know how to fix. Please help. Thank you so much.
>> 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 linker) [2] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 linker) [3] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 linker) [4] Microsoft Platform SDK 14.0 [5] Microsoft Visual C++ 2005 [6] Microsoft Visual C++ 2008
[0] None
Compiler: 6
The default location for Microsoft Visual C++ 2008 compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0, but that directory does not exist on this machine.
Use C:\Program Files (x86)\Microsoft Visual Studio 9.0 anyway [y]/n? y
Please verify your choices:
Compiler: Microsoft Visual C++ 2008 Location: C:\Program Files (x86)\Microsoft Visual Studio 9.0
Are these correct [y]/n?
*********************************************************************** Warning: MEX-files generated using Microsoft Visual C++ 2008 require that Microsoft Visual Studio 2008 run-time libraries be available on the computer they are run on. If you plan to redistribute your MEX-files to other MATLAB users, be sure that they have the run-time libraries. ***********************************************************************
Trying to update options file: C:\Users\sor\AppData\Roaming\MathWorks\MATLAB\R2008a\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2008a\bin\win64\mexopts\msvc90opts.bat
Done . . .
********************************************************************** 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. **********************************************************************
>> mex yprime.c Error: Could not find the compiler "cl" on the DOS path. Use mex -setup to configure your environment properly.
C:\PROGRA~1\MATLAB\R2008A\BIN\MEX.PL: Error: Unable to locate compiler. ??? Error using ==> mex at 207 Unable to complete successfully.
When the utility asks "Would you like mex to locate installed compilers [y]/n?", it is best to say 'y' and allow "mex -setup" to locate your compiler automatically. If it is unable to find your compiler, then there is most likely something wrong with your configuration. Here is the list of supported compilers for your version of MATLAB. Please make sure that you have the Professional Edition of Visual C++ 2008 installed. Also, pay attention to footnote#6:
"To use Microsoft Visual Studio with MATLAB® on 64-bit systems, "X64 Compilers and Tools" must be chosen during installation of Microsoft Visual Studio. This is not selected by default."
Nak So
Nak So il 24 Lug 2012
Modificato: Nak So il 24 Lug 2012
I already installed Microsoft Visual Studio 2008, but I didn't know about this note:"To use Microsoft Visual Studio with MATLAB® on 64-bit systems, "X64 Compilers and Tools" must be chosen during installation of Microsoft Visual Studio. This is not selected by default."
Is there any way to fix this?
Thanks,
Nak
Walter Roberson
Walter Roberson il 24 Lug 2012
Modificato: Walter Roberson il 24 Lug 2012
Reinstall VS2008 selecting that option.
And as far as the setup utility can tell you did not install VS2008, at least not where it expects. You should let it search for compilers.
Nak So
Nak So il 24 Lug 2012
Thank you Kaustubha and Walter.

Accedi per commentare.

Più risposte (0)

Categorie

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by