| Contents | Index |
cc = mex.getCompilerConfigurations()
cc = mex.getCompilerConfigurations('lang')
cc = mex.getCompilerConfigurations('lang','list')
cc = mex.getCompilerConfigurations() returns a mex.CompilerConfiguration object cc containing information about the selected compiler configuration used by mex. The selected compiler is the one you choose when you run the mex -setup command. For details about the mex.CompilerConfiguration class, see mex.CompilerConfiguration.
cc = mex.getCompilerConfigurations('lang') returns an array of mex.CompilerConfiguration objects cc containing information about the selected configuration for the given lang. If the language of the selected complier is different from lang, then cc is empty.
Language lang is a string with one of the following values:
'Any' — All supported languages. This is the default value.
'C' — All C compiler configurations, including C++ configurations.
'C++' or 'CPP' — All C++ compiler configurations.
'Fortran' — All Fortran compiler configurations.
cc = mex.getCompilerConfigurations('lang','list') returns an array of mex.CompilerConfiguration objects cc containing information about configurations for the given language and the given list. Values for list are:
'Selected' — The compiler you chose when you ran mex-setup. This is the default value.
'Installed' — All supported compilers mex finds installed on your system.
'Supported' — All compilers supported in the current release. For an up-to-date list of supported compilers, see the Supported and Compatible Compilers Web page.
The mex.CompilerConfiguration class contains the following read-only properties about compiler configurations.
| Property | Purpose |
|---|---|
| Name | Name of the compiler |
| Manufacturer | Name of the manufacturer of the compiler |
| Language | Compiler language |
| Version | (Windows platforms only) Version of the compiler |
| Location | (Windows platforms only) Folder where compiler is installed |
| Details | A mex.CompilerConfigurationDetails object containing specific information about build options. For details about this class, see mex.CompilerConfigurationDetails. |
The mex.CompilerConfigurationDetails class provides information about the command options used by the compiler, linker and other build programs used to create MEX-files. These properties are read-only.
| Property |
|---|
| CompilerExecutable |
| CompilerFlags |
| OptimizationFlags |
| DebugFlags |
| LinkerExecutable |
| LinkerFlags |
| LinkerOptimizationFlags |
| LinkerDebugFlags |
myCompiler = mex.getCompilerConfigurations()
MATLAB software displays information similar to the following (depending on your architecture, your version of MATLAB, and what you selected when you ran mex -setup):
myCompiler =
mex.CompilerConfiguration
Package: mex
Properties:
Name: 'Microsoft Visual C++ 2005'
Manufacturer: 'Microsoft'
Language: 'C++'
Version: '8.0'
Location: '%VS80COMNTOOLS%\..\..'
Details: [1x1 mex.CompilerConfigurationDetails]
MethodsallCC = mex.getCompilerConfigurations('Any','Supported')
MATLAB displays information similar to the following:
allCC =
1x11 mex.CompilerConfiguration
Package: mex
Properties:
Name
Manufacturer
Language
Version
Location
Details
MethodsThis version of MATLAB supports eleven configurations, hence, allCC is a 1-by-11 matrix.
To see what C compilers MATLAB supports, type:
cLanguageCC = mex.getCompilerConfigurations('C','Supported')
MATLAB displays the following information (the number of compilers for your version of MATLAB may be different):
cLanguageCC =
1x9 mex.CompilerConfiguration
Package: mex
Properties:
Name
Manufacturer
Language
Version
Location
Details
Methods
To display the compiler names, type:
format compact cLanguageCC.Name
MATLAB displays information similar to the following:
ans = Intel C++ ans = Lcc-win32 ans = Microsoft Visual C++ ans = Microsoft Visual C++ 2003 ans = Microsoft Visual C++ 2005 Express Edition ans = Microsoft Visual C++ 2005 ans = Microsoft Visual C++ 2008 ans = Open WATCOM C/C++
To see what build options MATLAB uses with a particular C compiler, create an array CC of all supported C compiler configurations:
CC = mex.getCompilerConfigurations('C','Supported');
disp('Compiler Name')
for i = 1:3; disp(CC(i).Name); end;
MATLAB displays a list similar to:
Intel C++ Lcc-win32 Microsoft Visual C++
To see the build options for the Microsoft Visual C++ compiler, type:
CC(3).Details
MATLAB displays information similar to the following (output is formatted):
ans =
mex.CompilerConfigurationDetails
Package: mex
Properties:
CompilerExecutable: 'cl'
CompilerFlags: '-c -Zp8 -G5 -W3 -EHs
-DMATLAB_MEX_FILE -nologo /MD'
OptimizationFlags: '-O2 -Oy- -DNDEBUG'
DebugFlags: '-Zi
-Fd"%OUTDIR%%MEX_NAME%.pdb"'
LinkerExecutable: 'link'
LinkerFlags: [1x258 char]
LinkerOptimizationFlags: ''
LinkerDebugFlags: '/debug'
Methods
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |