# Cross Compiling for Linux-ARM/Raspberry PI 3

**URL:** <https://forums.unrealengine.com/t/cross-compiling-for-linux-arm-raspberry-pi-3/411490>\
**Category:** Platform & Builds\
**Tags:** cross-compiling, arm, Linux, unreal-engine, question\
**Created:** [December 5, 2017, 10:03pm UTC](https://forums.unrealengine.com/t/cross-compiling-for-linux-arm-raspberry-pi-3/411490 "2017-12-05T22:03:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_08787d181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_08787d181](https://forums.unrealengine.com/u/anonymous_user_08787d181)\
**Post date:** [December 5, 2017, 10:03pm UTC](https://forums.unrealengine.com/t/cross-compiling-for-linux-arm-raspberry-pi-3/411490/1 "2017-12-05T22:03:17Z")

</div>

I have tried this for various versions of Unreal and can really using Anything between 4.15 - 4.18  
I started by following:  
[https://wiki.unrealengine.com/Compiling\_For\_Linux](https://wiki.unrealengine.com/Compiling_For_Linux)

But its really unclear where to start. So there is clang-3.5.0-arm but it seems like that is for Unreal version \<= 4.8

So instead started to follow the directions to build my own to function with a version of unreal my game works with following these directions  
[https://wiki.unrealengine.com/Building\_Linux\_cross-toolchain](https://wiki.unrealengine.com/Building_Linux_cross-toolchain)

So since I am currently using Unreal version 4.18 I download v10 clang 5.0.0-based. I copy this to my ARM device which is running Ubuntu 16.04 (I thought that version was recommended somewhere but I cant find it any more)

I install all the required packages and unzip. The I change directories to build/scripts and run the command /BuildCrossToolchain.sh  
Turns out this file has some windows line feeds that prevent it from building. I dos2unix that file. Then I get an issue further down the line with a .config.2 file having a ‘/r’. Seems like that file is pulled from a repo or something

My question is am I even heading in the right direction? Is this the correct first step? What am I even building , it seems like its building a special version of gcc? or is this clang I am building? Is there a prebuilt version of this somewhere?

[Update] with help from RCL

- Download V10 clang from description for 4.18
- Unzip it into a stable location (eg c:\dev)
- Set environment variable LINUX\_MULTIARCH\_ROOT ( EG c:\dev\v10\_clang-5.0.0-centos7) This directory has the sub folder arm-unknown-linux-gnueabih (this will be refrenced later)
- In your Unreal project edit /Config/DefaultEngine.ini add or modify the value

> ```
> [/Script/LinuxTargetPlatform.LinuxTargetSettings]
> TargetArchitecture=ArmUnknownLinuxGnueabihf
> 
> ```

- Edit your Engine seetings UEBUildLinux.cs (eg C:\Program Files\Epic Games\UE\_4.18\Engine\Source\Programs\UnrealBuildTool\Platform\Linux\UEBuildLinux.cs)

> ```
> static private string DefaultArchitecture = "x86_64-unknown-linux-gnu"; 
> 
> ```

and un-commenting the linux-arm architecture line just below it:

> ```
> //static private string DefaultArchitecture = "arm-unknown-linux-gnueabihf";
> 
> ```

this is the path for the sub-directory referenced byLINUX\_MULTIARCH\_ROOT

- Back in your project directory regenerate your sln file Right-click on your .uproject and select “Generate Visual Studio Project Files”

---

<div class="post-metadata">

**Author:** ![RCL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RCL](https://forums.unrealengine.com/u/RCL)\
**Post date:** [December 5, 2017, 10:13pm UTC](https://forums.unrealengine.com/t/cross-compiling-for-linux-arm-raspberry-pi-3/411490/2 "2017-12-05T22:13:59Z")

</div>

You don’t need to build your own cross-toolchain anymore - since version 8 of the toolchain, ARM and AArch64 sysroots are included in the zip (you can examine its contents), you just need to set it up using LINUX\_MULTIARCH\_ROOT variable and not deprecated LINUX\_ROOT one. Edit your project’s DefaultEngine.ini and add (or change, if it exists) this section:

```
[/Script/LinuxTargetPlatform.LinuxTargetSettings]
TargetArchitecture=ArmUnknownLinuxGnueabihf

```

then re-build the Linux binaries (from scratch). You may encounter compiler errors since some targets will try to build ShaderCompileWorker first - please ignore ShaderCompileWorker ones as you don’t need SCW on the device.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_08787d181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_08787d181](https://forums.unrealengine.com/u/anonymous_user_08787d181)\
**Post date:** [December 6, 2017, 2:47pm UTC](https://forums.unrealengine.com/t/cross-compiling-for-linux-arm-raspberry-pi-3/411490/3 "2017-12-06T14:47:44Z")

</div>

Thanks for the help! Ok this seems to change things now I am getting errors like this below, did I do something else wrong? (I added all my steps to the main question above if that helps but I referenced c drive instead of d to help others)  
UATHelper: Packaging (Linux): [2/24] Compile PCH.UELinkerFixups.h  
UATHelper: Packaging (Linux): d:\dev\TestProject 4.18\Intermediate\Build\Linux\48086BB4\TestProject\Development\UELinkerFixups\PCH.UELinkerFixups.h(2,10): error: non-portable path to file ‘“d\dev\TestProject 4.18\Intermediate\Build\Linux\48086BB4\UE4\Development\UELinkerFixupsName.h”’; specified path differs in case from file name on disk [-Werror,-Wnonportable-include-path]

---

<div class="post-metadata">

**Author:** ![Flash7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Flash7](https://forums.unrealengine.com/u/Flash7)\
**Post date:** [March 31, 2018, 9:56pm UTC](https://forums.unrealengine.com/t/cross-compiling-for-linux-arm-raspberry-pi-3/411490/4 "2018-03-31T21:56:32Z")

</div>

have you found a solution for that error? I’m having the same exact issue.

---

<div class="post-metadata">

**Author:** ![RCL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RCL](https://forums.unrealengine.com/u/RCL)\
**Post date:** [April 3, 2018, 7:59pm UTC](https://forums.unrealengine.com/t/cross-compiling-for-linux-arm-raspberry-pi-3/411490/5 "2018-04-03T19:59:37Z")

</div>

Make sure you use consistent case in all your disk paths, in #include or otherwise.  
Please examine the reported path and see if there’s something in it that is spelled differently in the actual file system, e.g. Dev instead of dev.

---

<div class="post-metadata">

**Author:** ![DM-999](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DM-999](https://forums.unrealengine.com/u/DM-999)\
**Post date:** [October 29, 2019, 5:03pm UTC](https://forums.unrealengine.com/t/cross-compiling-for-linux-arm-raspberry-pi-3/411490/6 "2019-10-29T17:03:42Z")

</div>

Should one still compile UE 4.23 in Windows as described above in order to get an ARM version? [I’m trying to get a version of UE 4 for the NVIDIA Nano].
