Category Archives: MATLAB

An workaround for mex within MATLAB, “No supported compiler or SDK was found.”

I faced an error “No supported compiler or SDK was found.” when I tried to compile mexlised cpp file on MATLAB2015a (Mac 10.10.5).

MATLAB complains as fellow when “mex -setup” command is issued.

“No supported compiler or SDK was found.” which means that either no compiler has been installed on your system or not properly been linked with MATLAB’s mex.

The following link worked for my case and I could successfully compile mexlised cpp files.

http://www.mathworks.com/matlabcentral/answers/246507-why-can-t-mex-find-a-supported-compiler-in-matlab-r2015b-after-i-upgraded-to-xcode-7

And the attached xcode7_mexopts

Hope this save some your time.

 

Set-up mex in MATLAB2015a within MacOS Yosemite(10.10.3)

Here is a workaround for setting up mex in MATLAB2015a within MacOS Yosemite.

You need to install two software packages: Command Line Tools (CLT) and gfortran.

1. Installation of CLT

Simply download the following and install. (You need Xcode 6.3 or higher as a prerequisite).

https://developer.apple.com/downloads/index.action?name=for%20Xcode

2. Installation of gfortlan

go to the following site and download gfortran 5.0

http://hpc.sourceforge.net/

Direct download link for gfortran 5.0

You will have gfortran-5.0-bin.tar in your downloaded folder.

Open terminal console and type the following for gfortran installation

sudo tar -xvf gfortran-5.0-bin.tar -C /.

Note that don’t forget “/.” at the end of the command line.

You will see some log messages copying files into your /usr/local/bin and related folders.

Done!

For verification, just type “mex -setup FORTRAN” in MATLAB console. This should show you the following message.

 

MEX configured to use 'gfortran' for FORTRAN language compilation.
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/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.

MATLAB 2014a Bug, BLAS loading error: dlopen: cannot load any more object with static TLS

This article is Just for future reference.

I faced a MATLAB bug: BLAS loading error: dlopen: cannot load any more object with static TLS.

My MATLAB version is 2014a running on Ubuntu 14.04.01

Here is the workaround and what you only need to do is

1. Download the attached file from the following link.

2. Replace libiomp5.so file at /R2014a/sys/os/glnxa64 (Ubuntu)

http://de.mathworks.com/support/bugreports/961964

Cheers,