Merge pull request #34 from MattiaMontanari/33-error-using-mex-matlab-under-linux

Build mex on linux
fixes-turtlebasket
Mattia Montanari 2022-11-01 09:57:48 +01:00 committed by GitHub
commit 7a018a3c60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -38,10 +38,10 @@ end
% TRY COMPILING MEX FILE
fprintf('Compiling mex function... ')
try
mex(fullfile('..','..','src','openGJK.c'),... % Source of openGJK
mex(fullfile('..','..','openGJK.c'),... % Source of openGJK
'-largeArrayDims', ... % Support large arrays
optflug, ... % Compiler flag for debug/optimisation
fullfile('-I..','..','include'),... % Folder to header files
fullfile('-I','..','..','include'),... % Folder to header files
'-outdir', pwd, ... % Ouput directory for writing mex function
'-output', 'openGJK',... % Name of ouput mex file
'-DMATLAB_MEX_BUILD',... % Define variable for mex function in source files

View File

@ -730,7 +730,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
nCoordsB = mxGetN(prhs[1]);
/* Create output */
plhs[0] = mxCreategkFloatMatrix(1, 1, mxREAL);
plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL);
/* get a pointer to the real data in the output matrix */
distance = mxGetPr(plhs[0]);
@ -763,7 +763,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
s.nvrtx = 0;
/* Compute squared distance using GJK algorithm */
distance[0] = gjk(bd1, bd2, &s);
distance[0] = compute_minimum_distance(bd1, bd2, &s);
mxFree(arr1);
mxFree(arr2);