labstreaminglayer / liblsl-Matlab

Matlab bindings for liblsl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

liblsl dylib not compatible with early macOs

sari-saba-sadiya opened this issue · comments

Hi,

When running 'lsl_loadlib()' I get the error below. I assume that liblsl.1.14.0.dylib is compiled for macOS post version 15. I am running El Capitan (10.11.16) I used codex version 7.3 and then tried also with versions 7.0 and 6.4 but got the same problem. I am running MATLAB 2015 and have followed your guide and the answer here to set up my mex.

I believe this requires the dylib to be compiled with a lower deployment target.

Thanks

Error using lsl_loadlib (line 47) Error loading the liblsl library: Invalid MEX-file '/Users/admin/Documents/MATLAB/liblsl-Matlab/bin/lsl_loadlib_.mexmaci64': dlopen(/Users/admin/Documents/MATLAB/liblsl-Matlab/bin/lsl_loadlib_.mexmaci64, 6): Symbol not found: ____chkstk_darwin Referenced from: /Users/admin/Documents/MATLAB/liblsl-Matlab/bin//liblsl.1.14.0.dylib Expected in: /usr/lib/libSystem.B.dylib in /Users/admin/Documents/MATLAB/liblsl-Matlab/bin//liblsl.1.14.0.dylib. Make sure liblsl-Matlab/bin is added to path and try running build_mex.m

Hi @sari-saba-sadiya ,

There's a seemingly infinite combinations of system libraries, toolchains, and matlab versions across all the platforms we target. And there aren't any great options for doing continuous integration and deployment where Matlab is concerned. I'm sorry we can't supply mex files for more than a handful of targets.

But we should be able to supply liblsl for slightly older Macs. I don't have a good way of testing though. We use GitHub Actions for CI & CD. You can see the provided runners here. As you can see, they only go back as far as MacOS 10.15... but there might be a way to target older versions from new MacOS.

Until that gets figured out, liblsl release 1.13.1 has dylib for MacOS 10.12. Will that work for you? release 1.12 also has OSX files but I have no idea what version they were targeting.

Once you find a dylib that works, it's unlikely that any of the previously released mex files will work with your particular combination so you're better off building those on your own. If you really want to trudge through some old ones then you can look in the old ftp. (there are some old dylibs there too)

If you happen to find a dylib that works for you and you come across a robust way for matlab to identify the running operating system version then maybe we can augment lsl_get_dll.m to download the better dylib, or at least print a helpful error message and not download the incorrect dylib.

Thank you for the quick response. Changing different software version did end up working.

For anyone interested. I ended up updating my macOS to high sierra (10.13.6), matlab to 2017b, and downgraded to liblsl 1.13.1. This combination works so far after building the mex files with Xcode 9 (Xcode 7 didn't work).