mex -O resize.cc
mex -O dt.cc
mex -O features.cc
mex -O getdetections.cc


mexcmd = 'mex ';

mexcmd = [mexcmd ' -O'];
  
%Jorge - Added optimization support for SSE, without it this does not
%work
mexcmd = [mexcmd ' CXXOPTIMFLAGS="-O3 -DNDEBUG -msse -msse2 -msse3 -mfpmath=sse"'];
mexcmd = [mexcmd ' LDOPTIMFLAGS="-O3"'];

% Turn all warnings on
mexcmd = [mexcmd ' CXXFLAGS="\$CXXFLAGS -Wall"'];
mexcmd = [mexcmd ' LDFLAGS="\$LDFLAGS -Wall"'];

eval([mexcmd ' fconvsse.cc -o fconv']);

% use one of the following depending on your setup
% 0 is fastest, 3 is slowest 

% 0) multithreaded convolution using SSE
%mex CXXOPTIMFLAGS = "-O3 -DNDEBUG -msse -msse2 -msse3 -mfpmath=sse" fconv -O fconvsse.cc -o 

% 1) multithreaded convolution using blas
%    WARNING: the blas version does not work with matlab >= 2010b 
%    and Intel CPUs
% mex -O fconvblasMT.cc -lmwblas -o fconv

% 2) mulththreaded convolution without blas
% mex -O fconvMT.cc -o fconv

% 3) convolution using blas
% mex -O fconvblas.cc -lmwblas -o fconv

% 4) basic convolution, very compatible
% mex -O fconv.cc -o fconv
