MATLAB: How to determine the currently selected compiler before using the MEX command in MATLAB 7.0 (R14) and later

compoptscompopts.batcompopts.shMATLABmbuildmexmexoptsmexopts.batmexopts.sh

I would like to see which compiler is currently selected before issuing the MEX command in MATLAB 7.0 (R14) and later.

Best Answer

This enhancement has been incorporated in MATLAB 7.6 (R2008a). You can use the following command to get the currently selected compiler for MEX:
mex.getCompilerConfigurations
For more information on this topic, please visit the following website:
<http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/mex.getcompilerconfigurations.html>
For previous product releases, read below for any possible workarounds:
you can determine the currently selected compiler for MEX by viewing the following options files:
1. On Windows: mexopts.bat
2. On Linux/UNIX/Mac: mexopts.sh,
This is located in the preferences directory on your machine. The complete address of the preference directory can be obtained using the following command:
prefdir
To determine the currently selected compiler before using the MCC or the MBUILD command, open the following options files in the above directory:
1. On Windows: compopts.bat
2. On Linux/Unix/Mac: compopts.sh file
These option files contain the settings for the current compiler.