GCC Build Enviornment


I have a docker image that I use for building C++ projects using GCC and other tools. For a specific project, I am to successfully build the C++ project when docker is running on a Linux host.

However, I tried to build the same source code using an image built from the same docker file on MacOS (M1 Chip) and got compile errors. In particular, this file was not found: xmmintrin.h, which seems to be related to gcc.

Could this be caused by the fact that docker desktop on MacOS relies on a VM? Or could it be related to the M1 chip or something else?

I am trying to understand more fully what the implications are running docker on MacOS using a VM rather that’s directly in Linux.

Any suggestions or help would be greatly appreciated.


The VM itself shouldn’t matter in this case. However I can imagine two reasons.

  • You are trying to use an image created for amd64 architecture so Docker Desktop has to emulate the architecture on an arm664 cpu (M1) and emulation is not always perfect.
  • Different CPU could require different libraries, header files.

I have searched for xmmintrin.h, on Google and the first result was his: missing xmmintrin.h on ARM devices. · Issue #43 · kakao/n2 · GitHub

So I guess it is related to the arm64 cpu.