function mexme_mtbot(options)
% Compile each mex-files of the core functions
%
% Usage
% ------
%
% mexme_mtbot([options])
%
% Inputs
% -------
%
% options options strucure
% config_file If user need a particular compiler config file (default config_file = []).
% ext Extention to the compiled files (default ext = [])
%
%
%
% Example1 (with MSVC compiler or LCC compiler)
% -------
%
% mexme_mtbot;
%
% Example2 (with Intel Compiler )
% -------
%
% options.config_file = 'mexopts_intel10.bat';
% options.ext = 'dll';
% mexme_mtbot(options);
%
%
% Author : Sbastien PARIS : sebastien.paris@lsis.org
% ------- Date : 04/01/2010
%
%
if( (nargin < 1) || isempty(options) )
options.config_file = [];
options.ext = [];
end
if(~any(strcmp(fieldnames(options) , 'config_file')))
options.config_file = [];
end
if(~any(strcmp(fieldnames(options) , 'ext')))
options.ext = [];
end
if(~exist(options.config_file , 'file'))
options.config_file = [];
end
warning off
files1 = {'poisrnd.c matrixjpl.c randomlib.c' , 'ndtimes.c' , 'ndchol.c' , 'particle_resampling.c -DranSHR3 ' , ...
'part_moment.c' , 'ndellipse.c' , 'likelihood_bot.c -DranSHR3'};
for i = 1 : length(files1)
str = [];
if(~isempty(options.config_file))
str = ['-f ' , options.config_file , ' '];
end
temp = files1{i};
ind = find(isspace(temp));
[dummy , name] = fileparts(temp(1:ind-1));
if(~isempty(options.ext))
str = [str , '-output ' , name , '.' , options.ext , ' '];
end
str = [str , temp];
disp(['compiling ' temp])
eval(['mex ' str])
end
warning on