Tuesday, January 14, 2025

hacky workaround for installing megahit on MacOSX

 Running some assemblies on a Mac Studio Apple M2Ultra macOS Sonoma 14.6.1.

I have had a terrible time getting megahit to build from source. After some very hacky workarounds, I was able to get it to install using conda, but when I would run it, even just a test case, I would get the following error:

Error Please refer to ../06_megahit_assembly_Ap/log for detail 
megahit -1 Alvinella_pompejana_YPM109526_sm22274-sg_R1_001_trim_hostFilt_hostFilt2_normalized_repair.fq -2 Alvinella_pompejana_YPM109526_sm22274-sg_R2_001_trim_hostFilt_hostFilt2_normalized_repair.fq -o ../06_megahit_assembly_Ap -m 128e9 --kmin-1pass -t 8; Exit code -11

I would use the binaries, but it appears it is all made for Linux these days. To get around this, I had to settle with a very old binary.

wget https://github.com/voutcn/megahit/releases/download/v1.1.1/megahit_v1.1.1_DARWIN_CPUONLY_x86_64-bin.tar.gz

tar zvxf megahit_v1.1.1_DARWIN_CPUONLY_x86_64-bin.tar.gz


I renamed and relocated the folder, then added the folder to my PATH and I no longer get the Exit -11 error. Obviously not ideal, but it is working.