Mensen / ept_TFCE-matlab

Advanced EEG Statistics
27 stars 9 forks source link

mex issues #24

Open normanF opened 4 years ago

normanF commented 4 years ago

Hi Armand, hope you are doing well!

I have an issue with compiling the c files under windows (previously your tools worked neatly under linux). Although it is saying "MEX completed succesfully." there are several warnings during the compiling process:

mex ept_mex_TFCE.c Building with 'MinGW64 Compiler (C)'. F:\MatlabLibraries\Tools\othmatlablib\unfold\lib\ept_TFCE\TFCE\Dependencies\ept_mex_TFCE.c: In function 'mexFunction': F:\MatlabLibraries\Tools\othmatlablib\unfold\lib\ept_TFCE\TFCE\Dependencies\ept_mex_TFCE.c:201:6: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] dims = mxGetDimensions(prhs[0]); ^ F:\MatlabLibraries\Tools\othmatlablib\unfold\lib\ept_TFCE\TFCE\Dependencies\ept_mex_TFCE.c:212:37: warning: passing argument 2 of 'mxCreateNumericArray_730' from incompatible pointer type [-Wincompatible-pointer-types] plhs[0] = mxCreateNumericArray(ndim,dims,mxDOUBLE_CLASS, mxREAL); ^~~~ In file included from F:\Programme\MATLAB\R2019a/extern/include/mex.h:43:0, from F:\MatlabLibraries\Tools\othmatlablib\unfold\lib\ept_TFCE\TFCE\Dependencies\ept_mex_TFCE.c:8: F:\Programme\MATLAB\R2019a/extern/include/matrix.h:276:30: note: expected 'const mwSize {aka const long long unsigned int }' but argument is of type 'const int *'

define mxCreateNumericArray mxCreateNumericArray_730

                          ^

F:\Programme\MATLAB\R2019a/extern/include/matrix.h:1248:1: note: in expansion of macro 'mxCreateNumericArray' mxCreateNumericArray(mwSize ndim, const mwSize *dims, mxClassID classid, mxComplexity flag);

When calling ept_tfce on a time course of EEG data I get non-sensible and identical p-values for all time points (1.0e-04 * 0.9998).

Have you encountered this issue before and if so do you know how to fix it?

Best Norman

normanF commented 4 years ago

Hi again, somehow I overlooked that there was already a similar issue before and you already found the solution that I will just paste here :) Thanks a lot for investigating this!

The warnings disappear if an option flag is added to the compiling call, e.g.,: mex ept_mex_TFCE.c -compatibleArrayDims

Best, Norman