2022-07-09 14:10:45 -07:00
|
|
|
% _____ _ _ __ %
|
|
|
|
% / ____| | | |/ / %
|
|
|
|
% ___ _ __ ___ _ __ | | __ | | ' / %
|
|
|
|
% / _ \| '_ \ / _ \ '_ \| | |_ |_ | | < %
|
|
|
|
% | (_) | |_) | __/ | | | |__| | |__| | . \ %
|
|
|
|
% \___/| .__/ \___|_| |_|\_____|\____/|_|\_\ %
|
|
|
|
% | | %
|
|
|
|
% |_| %
|
|
|
|
% %
|
|
|
|
% Copyright 2022 Mattia Montanari, University of Oxford %
|
|
|
|
% %
|
|
|
|
% This program is free software: you can redistribute it and/or modify it under %
|
|
|
|
% the terms of the GNU General Public License as published by the Free Software %
|
|
|
|
% Foundation, either version 3 of the License. You should have received a copy %
|
|
|
|
% of the GNU General Public License along with this program. If not, visit %
|
|
|
|
% %
|
|
|
|
% https://www.gnu.org/licenses/ %
|
|
|
|
% %
|
|
|
|
% This program is distributed in the hope that it will be useful, but WITHOUT %
|
|
|
|
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS %
|
|
|
|
% FOR A PARTICULAR PURPOSE. See GNU General Public License for details. %
|
|
|
|
|
|
|
|
clearvars
|
|
|
|
|
|
|
|
% SELECT OPTIMISATION FLAG - FASTER BUT NOT SUITABLE FOR DEBUGGING
|
|
|
|
if 0
|
|
|
|
optflug = '-g'; %#ok<*UNRCH>
|
|
|
|
else
|
|
|
|
optflug = '-O';
|
|
|
|
end
|
|
|
|
% SELECT SILET COMPILATION MODE.
|
2023-02-14 06:05:20 -08:00
|
|
|
if 1
|
2022-07-09 14:10:45 -07:00
|
|
|
silflag = '-silent';
|
|
|
|
else
|
|
|
|
silflag = '-v';
|
|
|
|
end
|
|
|
|
|
2023-02-14 06:05:20 -08:00
|
|
|
% COMPILE MEX FILE
|
|
|
|
mex(fullfile('..','..','openGJK.c'),...
|
2022-07-09 14:10:45 -07:00
|
|
|
'-largeArrayDims', ... % Support large arrays
|
2023-02-14 06:05:20 -08:00
|
|
|
optflug, ...
|
|
|
|
['-I',fullfile('..','..','include')],... % Folder to header files
|
2022-07-09 14:10:45 -07:00
|
|
|
'-output', 'openGJK',... % Name of ouput mex file
|
2022-10-17 07:30:00 -07:00
|
|
|
'-DMATLAB_MEX_BUILD',... % Define variable for mex function in source files
|
2023-02-14 06:05:20 -08:00
|
|
|
silflag )
|
2022-07-09 14:10:45 -07:00
|
|
|
|
|
|
|
% RUN EXAMPLE
|
|
|
|
fprintf('Running example... ')
|
|
|
|
main
|
2022-10-17 07:30:00 -07:00
|
|
|
fprintf('completed!\n')
|