MATLAB: I am trying to MEX a fortran file on MAC OS with Xcode 8.2.1. However, when I try to MEX using ‘mex’ command I get the following error: “No supported compiler or SDK was found.

compilerfoundmacMATLABmexnoxcode

I am trying to MEX a fortran file on MAC OS with Xcode 8.2.1. However, when I try to MEX using 'mex' command I get the following error:   "No supported compiler or SDK was found. ERROR: verbose mode on" >> mex <filename.F> -v Verbose mode is on. Neither -compatibleArrayDims nor -largeArrayDims is selected. Using -compatibleArrayDims. In the future, MATLAB will require the use of -largeArrayDims and remove the -compatibleArrayDims option. For more information: http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html. No MEX options file identified; looking for an implicit selection. … Looking for compiler 'Intel Fortran Composer XE' … … Looking for environment variable 'IFORT_COMPILER16' …No. … Looking for environment variable 'IFORT_COMPILER15' …No. … Looking for environment variable 'IFORT_COMPILER14' …No. … Looking for environment variable 'IFORT_COMPILER13' …No. … Executing command 'which ifort' …No. Did not find installed compiler 'Intel Fortran Composer XE'. Error using mex No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2016b/maci64.html.

Best Answer

Xcode does not provide a FORTRAN compiler. To compile a FORTRAN file, you need to install one of the following Compilers as they support FORTRAN compilation. 
Intel Parallel Studio XE 2016 for Fortran Or
Intel Parallel Studio XE 2015 for Fortran Or
Intel Fortran Composer XE (2013).
Related Question