Build from source on Apple Silicon

  • Trying to build from source
  • Apple M2 Max Ventura

Am getting this error when I run Setup.command


Setting up bundled DotNet SDK

chmod: /Users/theuser/GitHub/UnrealEngine/Engine/Build/BatchFiles/Mac/../../../Binaries/ThirdParty/DotNet/6.0.302/mac-arm64/dotnet: No such file or directory
/Users/theuser/GitHub/UnrealEngine/Engine/Build/BatchFiles/Mac/../../../Binaries/ThirdParty/DotNet/6.0.302/mac-arm64
Engine/Build/BatchFiles/Mac/GitDependencies.sh: line 17: ./Engine/Binaries/DotNET/GitDependencies/osx-x64/GitDependencies: Bad CPU type in executable
  • List item
1 Like

I solved the issue by installing Visual Studio and all it’s components as recommended for the windows installation under Getting up and running.

Git Hub Unreal Engine

All seems good now.

Note, I had previously installed Visual Studio but took extra care on a second install to get the latest version that supports Apple Silicon which is here Visual Studio 2022 for Mac

You don’t have rosetta2 installed. The easiest is to run

softwareupdate --install-rosetta

This requires to read and agree to the terms of the Apple SLA.

Same problem, but the GitHub link is now dead, and just installing VS didn’t help. And yes, the Mac in question has Rosetta.

If it helps, I’ve found a few problems and workarounds for building Unreal Engine from source on Apple Silicon. I’m using a Mac mini M2 I purchased specifically for making Mac builds for Steam. I cloned the UE repository and switched branch to 5.2.

  1. My mini has a 512GB drive, so I tried putting the source on an external USB-C drive, but this didn’t work. I haven’t found a good solution; this appears to be a security issue. I had to move everything back to the internal drive for now.
  2. The Setup.sh script fails to run at the Terminal with GitDependencies exiting with killed 9 status. Seems like it is trying to (correctly?) run the arm64 version of this executable, but it isn’t compatible with my system. I manually switched to x86_64 for the Setup.sh file execution, and all went fine (env /usr/bin/arch -x86_64 /bin/zsh --login). I then switched back for the remainder of the build process (env /usr/bin/arch -arm64 /bin/zsh --login).
  3. The instructions (https://github.com/EpicGames/UnrealEngine/tree/5.2) say to build ShaderCompileWorker (correct!), then UE5, which doesn’t exist. I think this should be “UnrealEditor” now.