biostars / biostar-handbook

Issue tracker for the Biostar Handbook
57 stars 12 forks source link

mamba install with libarchive.13.dylib on M2 Mac #277

Open emilyvansyoc opened 1 year ago

emilyvansyoc commented 1 year ago

The switch to Apple silicon chips seems to be throwing a lot of software installs. I'm trying to do the biostar install on an M2 mac. If miniconda3 is installed for M1 (no M2 available yet) via https://docs.conda.io/en/latest/miniconda.html, most of the softwares including necessities like fastp, bowtie2, bwatools etc., are not yet available for the Miniconda3-latest-MacOSX-arm64.sh install. The error, when installing via mamba or conda, is that the packages cannot be found (even following the install instructions from the bowtie2 website). Following the install instructions for the intel chips (as in the http://data.biostarhandbook.com/install.sh -> https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh) creates a mamba error.

After some googling, the mamba error is because the default install of libarchive is libarchive.18.dylib and mamba expects libarchive.13.dylib. There is a workaround using: conda install libarchive -n base -c conda-forge --strict-channel-priority and the libarchive version can be viewed with ls ~/miniconda3/lib.

In the biostar install, I ran this command between steps 4 and 5 (after installing and initializing miniconda but before installing mamba). This fixes the mamba issue.

Then, the rest of the install steps run as-is.

Knowing exactly 2% of how conda works in general, hopefully this workaround helps get others by and it doesn't explode down the road!

ialbert commented 1 year ago

This is an issue that I hope to get to the bottom of this Fall, when I'll have the software installed on dozens of computers at the same time. It is hard to troubleshoot because the installation on my M2 it worked just fine with no problems. And then it is difficult to undo the install to try fresh with different parameters.

I believe one needs to run the Intel-based conda installer even on M1. It should run seamlessly under emulation.

And when that happens the whole system runs in Intel emulation mode and it will run and install the Intel-based software all run under emulation. I have a new M1 and ran the install with no problems.

But when someone installs the native M1 conda install then they can run into trouble.

What I have not 100% figured out yet is why sometimes the Intel based installer does not want to work on M1.

emilyvansyoc commented 1 year ago

Ah, good to know. This is a brand new laptop with no other software installs. I deleted miniconda3 several times in the aims of getting this to work so maybe I inadvertently fixed something else along the way

emilyvansyoc commented 1 year ago

I think the biggest issue is something with the libarchive and mamba dependencies. Here's a thread on it: https://github.com/mamba-org/mamba/issues/1826

ialbert commented 1 year ago

The installation instructions have been rewritten to use micro mamba a simplified and more general version of mamba

https://mamba.readthedocs.io/en/latest/micromamba-installation.html