Skip to content

Commit

Permalink
Merge pull request #34 from MattiaMontanari/33-error-using-mex-matlab…
Browse files Browse the repository at this point in the history
…-under-linux

Build mex on linux
  • Loading branch information
MattiaMontanari authored Nov 1, 2022
2 parents 018b27c + 5c72572 commit 7a018a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/matlab/runme.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
% 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
'-outdir', pwd,... % Ouput directory for writing mex function
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
silflag ) % Silent/verbose flag
Expand Down
4 changes: 2 additions & 2 deletions openGJK.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7a018a3

Please sign in to comment.