bioconda / bioconda-recipes

Conda recipes for the bioconda channel.
https://bioconda.github.io
MIT License
1.65k stars 3.29k forks source link

"illegal hardware instruction" error when running MUSCLE v5.2 and above on Apple M series with subdir osx_64 #52034

Open ori-scala opened 2 weeks ago

ori-scala commented 2 weeks ago

After installing the latest MUSCLE version (5.2), I'm getting the following error when trying to run MUSCLE.

illegal hardware instruction

I assume it's related to the Apple M series chipset, I'm using Apple M1 Pro.

To reproduce:

conda install bioconda::muscle==5.2.0 -y

Then run muscle --help and get:

muscle --help
[1]    14859 illegal hardware instruction  muscle --help

Then, downgrade using:

conda install bioconda::muscle==5.1.0 -y

and muscle --help works again with the following output:

muscle --help

muscle 5.1.osx64 []  34.4Gb RAM, 10 cores
Built May 15 2023 21:29:02
(C) Copyright 2004-2021 Robert C. Edgar.
https://drive5.com

This is help.txt
ori-scala commented 2 weeks ago

@apcamargo Thank you for the 5.3 build. Now both --version and --help are working well but running an actual alignment ends up with the same error:

[1]    42192 illegal hardware instruction  muscle -align  -output  -log

Maybe you can add that to the tests as well? Something like

muscle -align some_fasta_file.fasta -output output.fasta -log muscle_log.txt
apcamargo commented 2 weeks ago

Does -super5 work? It is included in the tests.

ori-scala commented 2 weeks ago

Nope, same error

[1]    42600 illegal hardware instruction  muscle -super5  -output  -log
apcamargo commented 2 weeks ago

Ok, so the problem might be on your end. Is your Mac a M series? Because the output of your muscle --help shows osx64, which is Intel. Maybe the binary of the wrong architecture is being installed.

How are you installing muscle?

ori-scala commented 2 weeks ago

The mac indeed has an M series chipset (M1 Pro) but I'm setting the conda env to osx64 using conda config --env --set subdir osx-64 as other packages I'm using aren't built for M series and I'm forced to do that.

I'm installing using an env.yml file or by conda install -c bioconda muscle==5.3.0 -y

apcamargo commented 2 weeks ago

I guess the other binaries are being executed through Rosetta? If so, I don't know why muscle isn't (assuming the issue is that the issue is that the binary is not compatible with the processor's architecture).

Do you have the same issue if you try to install other packages with ARM builds (e.g. diamond, mmseqs2, or hhsuite)?

I don't think I know enough about this to help you. If you're using Pixi, you can try to ask for help in their Discord (people there are very helpful). Otherwise, maybe @bioconda/osx can help?

ori-scala commented 2 weeks ago

You're correct, the other binaries are being executed through Rosetta. It doesn't happen with other packages nor with any muscle version prior to 5.2

apcamargo commented 2 weeks ago

In this case, I don't know what is going on. It could be something with the macOS ARM CI (as the build runs correctly there), but the core team would know better than me.

ori-scala commented 2 weeks ago

Ok, thank you anyway Antônio!

apcamargo commented 2 weeks ago

If you create an environment only for muscle and install the ARM version, does it work?

ori-scala commented 2 weeks ago

Yep, that works as expected.

apcamargo commented 2 weeks ago

This explains why the tests didn't catch this. From my understanding, the only major difference between the Bioconda build and Robert's build is that he is using GCC and Bioconda uses clang. As far as I know, there's no way for us to use GCC to build for macOS, but I don't really know our building system that well.

As you said, version 5.1 worked in Rosetta and it seems he used Clang back then (I'm inferring this from his CI). But the code changed a lot since then...

apcamargo commented 2 weeks ago

Can you update the issue title to something that reflects better the info we gathered?

ori-scala commented 2 weeks ago

@apcamargo updated the title as requested