alexdobin / STAR

RNA-seq aligner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error building docker image when compiling STAR on Mac M2 chip : error g++: error: unrecognized command-line option '-mavx2'

mblanche opened this issue · comments

Hi, seems like this has been a recurrent issues as I can track multiple ones, some close and some still open, but I can't track any one having this issue while building a Docker image.

PROBLEM
Building docker on Mac M2 fail with the following error error g++: error: unrecognized command-line option '-mavx2'

System description
Mac OS Sonoma 14.4.1
Chip: M2
Docker engine: Docker Desktop 4.28.0
Build Platform: linux/arm64
Docker image OS: Ubuntu Jammy (22.04)

Docker File

FROM ubuntu:22.04

ARG TARGETARCH

USER root

ENV DEBIAN_FRONTEND noninteractive

RUN apt update -y \
  && apt install -y \
  git \
  build-essential \
  zlib1g-dev \
  samtools \
  xxd \
  #gpg-agent \
  ca-certificates \
  && apt clean \
  && apt purge \
  && rm -rf /var/lib/apt/lists/* /tmp/*

RUN git clone https://github.com/alexdobin/STAR.git \
  && cd STAR/source \
  && make STAR

Trials
I've tried different linker flag and different make entries as suggest in the readme without success. Replacing make STAR1 with:

  • make STARforMacStatic produced the same error
  • make STAR CXXFLAGS_SIMD=sse or make STARforMacStatic CXXFLAGS_SIMD=sse errored with
38.55 g++: warning: sse: linker input file unused because linking not done
38.55 g++: error: sse: linker input file not found: No such file or directory

Potential Solutions
in issues # 1265, @mjsteinbaugh suggested using make STAR CXXFLAGS_SIMD=-std=c++11, which successfully compile. However, since this has not make it in the official ReadMe, I'm struggling a bit to deploy this in production pipelines

Could someone shed lights on possible solution for the new ARM64 architechture.