sccn / liblsl

C++ lsl library for multi-modal time-synched data transmission over the local network
Other
107 stars 63 forks source link

Apple M1 (arm64) support #164

Open stepanhruda opened 2 years ago

stepanhruda commented 2 years ago

Would you be able to produce & publish artifacts for new laptops with Apple arm64 chips? Looking at the latest artifact, it's still x86_64 based:

$ file liblsl.1.15.2.dylib 
liblsl.1.15.2.dylib: Mach-O 64-bit dynamically linked shared library x86_64

I was hoping to pull liblsl down from conda-forge - this new platform is called osx-arm64 in conda.

cboulay commented 2 years ago

It's all possible, but it takes time, there's always small details to figure out, and these details are annoyingly difficult to solve if you don't have your hands on the hardware. No one on the dev team has an M1 mac as far as I know. I'm hoping to get one when the next version of the macbook air comes out.

Until then, if you can try out the homebrew recipe and let me know how that goes then that would be helpful. https://github.com/labstreaminglayer/homebrew-tap

Second, if you can find a GitHub Actions example of someone building targets for M1 then that would be good too. I'm sure it exists but a cursory search didn't turn anything up.

Even if we get the GitHub Actions runner building for M1 targets, we still don't have all the signing and validation setup so I don't know if it would even work. The end user might have to explicitly allow them to bypass security and I remember there being something about this being harder on Apple Silicon devices. I might be wrong there.

^ Same issue applies for a conda-forge distribution.

stepanhruda commented 2 years ago

For conda-forge, they have a pretty detailed article about what changes are needed to the feedstock repo: https://conda-forge.org/blog/posts/2020-10-29-macos-arm64/

Not sure about GitHub Actions at the moment, will need to poke around since I haven't used them. I'd expect a separate job duplicated from macOS x86_64 with reasonably small changes to tell the toolchain to cross-compile – I guess the real problem would be if there are any incompatible CPU instructions.

stepanhruda commented 2 years ago

@cboulay I set up liblsl arm64 compilation for conda-forge if you could take a look: https://github.com/conda-forge/liblsl-feedstock/pull/4

cboulay commented 2 years ago

@tstenner is the one who got the conda-forge package started in the first place. Let's get his opinion.

cboulay commented 2 years ago

FYI I now have a MBP with an M1Pro. I've been using the homebrew recipe and it's working OK. I don't think I can share my precompiled binaries without doing all the signing stuff so you're better off just brew installing it.

(Though the homebrew recipe works for liblsl, I'm having trouble with LabRecorder. However, self-built LabRecorder is working fine for me.)