Cross-Compiling for Linux

Windows
MacOS
Linux

Cross-compiling makes it possible for game developers to target Linux from Windows. At this time, cross-compiling is only supported for Windows, and Mac users currently have to resort to native compiling. Additionally, we support, test, and provide libraries and toolchains for the Linux-x86_64 platform.

If you are developing your project with Unreal Engine, version 4.13 (or older), refer to the Cross-Compiling for Linux (Legacy) documentation.

Why Cross-Compilation

Cross-compilation makes it possible for game developers, working in a Windows-centric workflow, to target Linux. At this time, cross-compilation is only supported for Windows. Mac users currently have to resort to native compilation. We support, test, and provide the libraries and toolchains for the Linux-x86_64 platform.

Getting the Toolchain

Please use the following table to download the appropriate toolchain:

UE4 Version

Toolchain

4.22

-v13 clang-7.0.1-based

4.21

-v12 clang-6.0.1-based

4.19 and 4.20

-v11 clang-5.0.0-based

4.18

-v10 clang-5.0.0-based

4.16 and 4.17

-v9 clang-4.0.0-based

4.14 and 4.15

-v8 clang-3.9.0-based

4.11 thru 4.13

-v7 clang-3.7.0-based

4.9 and 4.10

-v6 clang-3.6.0-based

4.8 and earlier

-v4 clang-3.5.0-based

  • For toolchains -v8 through -v13 , there is no need to extract files or set the environment variable, just run the installer package.

  • For toolchains -v4 through -v7, we also provide the libraries and toolchains that enable you to compile for Linux ARM (original Raspberry Pi and up). Note that this will require you to make a (minor) code change in UnrealBuildTool (UBT).

  • We currently have driver support for AMDGPU-PRO (not RADV) for users running Unreal Engine on CentOS.

Targeting Specific Platforms

Because version 4.14 can only target the x86_64 platform, the following section is for developers working with version 4.15 or greater.

If you want your project to target a specific platform, you need to edit your project's Default Engine Configuration File file, and to do so, navigate to the file's location ([Project Directory]\Config), open DefaultEngine.ini, and add the following:

[/Script/LinuxTargetPlatform.LinuxTargetSettings]
TargetArchitecture=X86_64UnknownLinuxGnu

You may set TargetArchitecture to any of the following values:

  • X86_64UnknownLinuxGnu

  • ArmUnknownLinuxGnueabihf

  • AArch64UnknownLinuxGnueabi

Troubleshooting

To verify your current setup, run %LINUX_MULTIARCH_ROOT%x86_64-unknown-linux-gnu\bin\clang++ -v from the Command Prompt, which should display "clang version X.X.X ..." (see below):

env_var_clangsampleflush.png

Tags

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback