liblsl icon indicating copy to clipboard operation
liblsl copied to clipboard

Apple M1 (arm64) support

Open stepanhruda opened this issue 2 years ago • 5 comments

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.

stepanhruda avatar Mar 02 '22 21:03 stepanhruda

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.

cboulay avatar Mar 02 '22 21:03 cboulay

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 avatar Mar 02 '22 23:03 stepanhruda

@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

stepanhruda avatar Mar 07 '22 20:03 stepanhruda

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

cboulay avatar Mar 07 '22 20:03 cboulay

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.)

cboulay avatar Jun 27 '22 00:06 cboulay