sccn / xdf

BSD 2-Clause "Simplified" License
87 stars 34 forks source link

Is load_xdf automatically downloading a mex file? It doesn't work! #50

Closed dmedine closed 4 years ago

dmedine commented 4 years ago

Around 4pm CET today, all my analysis scripts broke because load_xdf and Matlab conspired to download an outdated version of the load_innerloop mex file. I see that this is trying to happen here: https://github.com/xdf-modules/xdf-Matlab/blob/5b27b8cf9577dd903cbfb5386ffbf04c0441eddb/load_xdf.m#L238-L259

But, as far as I know this has never worked. In anycase, now I get a dirty mex file in my xdf folder whenever I load a file and then I can't load data again until I delete it. I dealt with this by simply commenting the code out.

I am really quite perplexed because I was working on some analyses all day and then it just stopped working. I didn't do a pull, but that shouldn't matter because nothing has changed for quite some time anyway.

As a side note, I am also unable to compile the .c file, but that might be an issue with my C compiler environment rather than Matlab. It's tricky business dealing with the mex interface, but this can definitely be improved here.

sjeung commented 4 years ago

Following - I encountered the same issue yesterday and commenting out the part seems to have resolved it.

cboulay commented 4 years ago

@tstenner , is this intended to be solved by https://github.com/xdf-modules/xdf-Matlab/pull/5 ?

Can you please test it, @dmedine , @sjeung , @brainybrown2 ?

tstenner commented 4 years ago

Intended, but not checked as we don't have Matlab on Windows in our department.

dmedine commented 4 years ago

I can check it.

This doesn't explain (to me anyway) several things. The first is why all of a sudden load_xdf.m started behaving this way (I was literally using it all morning and then in the afternoon it started failing) or why the mex file it downloads is completely empty. I checked the commit history and didn't see anything that would explain this.

dmedine commented 4 years ago

And to anyone else having this issue, a temporary solution is to comment out the lines 237-259 and add the code:

have_mex = true;

at line 260. You will also have to delete any .mex file from the directory that has load_xdf.m in it.

cboulay commented 4 years ago

There are several changes to test. Please start with a fresh git clone --recursive https://github.com/sccn/xdf.git and try again.

Changes:

This definitely fixes the issue in the title, though I'm not 100% sure it fixes the other linked issues that we've redirected here. I'll close the issue anyway but we can create a new one or reopen this one if the problem persists.

dmedine commented 4 years ago

Works for me on Windows 10, Matlab 2019b. This update should also go upstream to the EEGLab repository. I am not quite sure how that is working these days, maybe Arno and Ramon have it all setup to be sync'd.

Thanks @tstenner for taking care of this! I was very worried that this would cause the whole world to explode. I anticipate a lot of spurious issues relating to this being posted in the future.

cboulay commented 4 years ago

It's been updated in the xdf-EEGLAB repository (here), but I have no idea how they sync that with their plugins distributions.

@arnodelorme can you please update whatever it is that needs to be updated to use the latest version of the above repository? It hasn't changed at all other than pointing to a newer version of the xdf-Matlab submodule.

phildean commented 4 years ago

I had a similar issue as above: R2018a MATLAB on Windows 10, latest EEGLAB and xdfimport. Scripts suddenly started failing, and came up with incompatible mex error. It was running fine for first load, but created an empty mex file for "load_xdf_innerloop.c" in the xdf folder. Used MATLAB MinGW-w64 C/C++ Compiler to create a mex file for "load_xdf_innerloop.c" and it worked after this. Glad to find a more elegant temporary solution above. thank you.

ghanada commented 4 years ago

Good work @cboulay! I was about to compile some mex files as well but you beat me to it. I just tested the update (using xdf-Matlab repo) on my Linux system (Ubuntu 16.0.4) using Matlab 2018a, and I confirmed it successfully downloaded the new mexa64 file, and used it properly for the import. I haven't tried other platforms, but wanted to confirm Linux works.