FranckLab / FIDVC

Fast Iterative Digital Volume Correlation Algorithm
31 stars 18 forks source link

mex error with Xcode 13.2.1 #29

Open josejmunoz opened 2 years ago

josejmunoz commented 2 years ago

Hello. When compiling in Apple M1 machine (version 12.0.1) function mirt3D_mexinterp.cpp with

mex mirt3D_mexinterp.cpp

I get the errors related to conversion of types from 'const mwSize ' to 'const int '. Has any body got similar errors? Sorry if this has already been reported.

Detail of the output error is as follows:

Building with 'Xcode Clang++'. Error using mex /Users/Code/FIDVC-1.2.4_2D/MatlabCode/Supplemental MFiles/mirt3D_mexinterp.cpp:173:13: error: incompatible pointer types assigning to 'const int ' from 'const mwSize ' (aka 'const unsigned long *') Xdims = mxGetDimensions(IN_S); ^~~~~ /Applications/MATLAB_R2021b.app/extern/include/matrix.h:277:25: note: expanded from macro 'mxGetDimensions'

define mxGetDimensions mxGetDimensions_730

/Users/josemunoz/Dropbox/research/MasterThesis/AngelIBMB/AngleEnriqueJose/Code/FIDVC-1.2.4_2D/MatlabCode/Supplemental MFiles/mirt3D_mexinterp.cpp:177:12: error: incompatible pointer types assigning to 'const int ' from 'const mwSize ' (aka 'const unsigned long *') dims = mxGetDimensions(IN_Z); ^~~~~ /Applications/MATLAB_R2021b.app/extern/include/matrix.h:277:25: note: expanded from macro 'mxGetDimensions'

define mxGetDimensions mxGetDimensions_730

                    ^

/Users/Code/FIDVC-1.2.4_2D/MatlabCode/Supplemental MFiles/mirt3D_mexinterp.cpp:203:13: error: no matching function for call to 'mxCreateNumericArray_730' OUT_F = mxCreateNumericArray(newXndim, newdims, mxDOUBLE_CLASS, mxREAL); ^~~~~~~~ /Applications/MATLAB_R2021b.app/extern/include/matrix.h:285:30: note: expanded from macro 'mxCreateNumericArray'

define mxCreateNumericArray mxCreateNumericArray_730

                         ^~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2021b.app/extern/include/matrix.h:955:1: note: candidate function not viable: no known conversion from 'int ' to 'const mwSize ' (aka 'const unsigned long ') for 2nd argument mxCreateNumericArray(mwSize ndim, const mwSize dims, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2021b.app/extern/include/matrix.h:285:30: note: expanded from macro 'mxCreateNumericArray'

define mxCreateNumericArray mxCreateNumericArray_730

ALandauer commented 2 years ago

Apologies for the delay - there doesn't seem to be anyone in the Franck Lab monitoring this repo, unfortunately. Hopefully you've found a solution, but in case not I'll mention a few things.

As far as I know we've never tested on the A1+Xcode platform, and mex compatibility on anything other than Windows+Intel complier can be spotty even on more conventional hardware in my experience. I don't recall if I ever actually got the mex working on my own Intel MBP, but that specifically is not an error I recall seeing before.

That said, if you want to use A1 hardware I'd recommend trying the built-in interp functions. For more info see my reply to Issue #23 and also take a look at here for a non-mex way to run the interpolation (in 2D, for that case).

Cheers, Alex