Date: Feb 13, 2013 11:33 AM
Author: James Tursa
Subject: Re: mex compile of matrixMultiply.c in MATLAB/R2012a/extern/examples/refbook fails
"shome" wrote in message <firstname.lastname@example.org>...
> In /usr/local/MATLAB/R2012a/extern/examples/refbook there are a few c files.all compiled with command mex filename.c except files with blas or lapak headers.One such example is shown below:
> >> mex matrixMultiply.c
> Warning: You are using gcc version "4.6.3-1ubuntu5)". The version
> currently supported with MEX is "4.4.6".
> For a list of currently supported compilers see:
> In file included from matrixMultiply.c:19:0:
> /usr/local/MATLAB/R2012a/extern/include/blas.h:595:0: warning: "dgemm" redefined [enabled by default]
> matrixMultiply.c:15:0: note: this is the location of the previous definition
> matrixMultiply.o: In function `mexFunction':
> matrixMultiply.c:(.text+0xf7): undefined reference to `dgemm_'
> collect2: ld returned 1 exit status
> mex: link of ' "matrixMultiply.mexa64"' failed.
> > In mex_helper at 36
> In mex at 204
> Error using mex (line 206)
> Unable to complete successfully.
> Kindly advise
You may need to explicitly point it to the BLAS library. E.g.,
mex -lmwblas matrixMultiply.c