Unreal Fails to Build on Linux

Hey All,

I am attempting to build UE4 from source on my Ubuntu 16.04 box. I keep getting this issue:

drcrook@BigBen:~/projects/UE4/UnrealEngine$ sudo make
bash “/home/drcrook/projects/UE4/UnrealEngine/Engine/Build/BatchFiles/Linux/Build.sh” CrashReportClient Linux Shipping
Building CrashReportClient…
Using clang version ‘3.8.0’ (string), 3 (major), 8 (minor), 0 (patch)
Creating makefile for CrashReportClient (no existing makefile)
Performing full C++ include scan (no include cache file)
Building UnrealHeaderTool…
Using clang version ‘3.8.0’ (string), 3 (major), 8 (minor), 0 (patch)
Target is up to date
Parsing headers for CrashReportClient
Running UnrealHeaderTool CrashReportClient “/home/drcrook/projects/UE4/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -NoEnginePlugins
Refusing to run with the root privileges.
Error: Failed to generate code for CrashReportClient - error code: CrashOrAssert (3)
UnrealHeaderTool failed for target ‘CrashReportClient’ (platform: Linux, module info: /home/drcrook/projects/UE4/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest).
Makefile:252: recipe for target ‘CrashReportClient-Linux-Shipping’ failed
make: *** [CrashReportClient-Linux-Shipping] Error 3

Any insights? I am following these instructions: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

Thanks!

I believe it’s because you are compiling it as root (you used the sudo command). Don’t use sudo just run make

Similar problem in Ubuntu 20.04

$ uname -a
Linux alexandr-Aspire-V5-571G 5.4.0-29-generic #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

UnrealEngine$ make
bash “/home/alexandr/working/UnrealEngine/Engine/Build/BatchFiles/Linux/Build.sh” CrashReportClient Linux Shipping
Fixing inconsistent case in filenames.
Setting up Mono
Building CrashReportClient…
Using ‘git status’ to determine working set for adaptive non-unity build (/home/alexandr/working/UnrealEngine).
Creating makefile for CrashReportClient (no existing makefile)
ERROR: Platform Linux is not a valid platform to build. Check that the SDK is installed properly.
make: *** [Makefile:302: CrashReportClient-Linux-Shipping] Ошибка 6

SIMILAR PROBLEM HERE



user@machine:~/Repository/UnrealEngine$ make
bash "/home/user/Repository/UnrealEngine/Engine/Build/BatchFiles/Linux/Build.sh" CrashReportClient Linux Shipping
Fixing inconsistent case in filenames.
Setting up Mono
Building CrashReportClient...
Using 'git status' to determine working set for adaptive non-unity build (/home/user/Repository/UnrealEngine).
Creating makefile for CrashReportClient (no existing makefile)
ERROR: Platform Linux is not a valid platform to build. Check that the SDK is installed properly.
Makefile:302: recipe for target 'CrashReportClient-Linux-Shipping' failed
make: *** [CrashReportClient-Linux-Shipping] Error 6


Hi, did anyone found a solution to this problem?

Hi, I think i managed to fix it (busy compiling so we will have to see)

First I navigated to /home/UnrealEngine

I ran



./Setup.sh


then



./GenerateProjectFiles.sh


The first on takes rather quick, the second one a few mins

finally I ran **WITHOUT **sudo



make UE4Editor UE4Game UnrealPak CrashReportClient ShaderCompileWorker UnrealLightmass


every time i tried to use a make command as sudo, I would get error reports. For now it seems to be compiling

Fedora seems to have changed recently, you now login as superuser using sudo!

I don’t know if I am late, what I did was, I changed the owner of my directory from root to my user account

Detailed Steps

At first, go to your the directory, where Unreal Engine 4 is present and it is not advised to use “su”

In my case, it was (For the sake of privacy, I am putting my user name as user)


**cd /home/user/Downloads/**

Then use ls -l to show who owns the directory
in my case, I will get


**ls -l**

The output I got was

xxxxx l root root (then date,then time) UnrealEngine

Now change the owner to your user account. in my case it was user,


**sudo chown -R user:user UnrealEngine**

Now type ls -l to verify that root was replaced by your user name


**ls -l**

The output i got was

xxxxx l user user (then date,then time) UnrealEngine

Now type ./Setup.sh


**./Setup.sh**

since I have already downloaded the file, I pressed “no” when I got

Would you like to override your changes? n

Now Type


**./GenerateProjectFiles.sh**

Then,


**make**

Now it will be compiled successfully

i followed all the advice listed earlier in this thread, but unfortunately i am completely unable to compile UE4.27 on kubuntu-20.04…

i went through the
./Setup.sh
./GenerateProjectFiles.sh
make

processes several times, each time i would get lots of non-fatal errors until the compilation process just froze or crashed.
it seems like several of the files just wouldn’t compile at all, advising me to include files from /tmp in the bugreport to bugs.llvm.org

however, now i get even less far in the compilation attempt :

i can’t even make it to the
make UE4Editor UE4Game UnrealPak CrashReportClient ShaderCompileWorker UnrealLightmass
command.

rene@sparrow:~/data1/unrealEngine/zip/UnrealEngine-4.27.0-release$ ./Setup.sh
Fixing inconsistent case in filenames.
Setting up Mono
Checking dependencies…
The following file(s) have been modified:
Engine/Binaries/ThirdParty/Mono/Linux/etc/mono/registry/last-btime
Would you like to overwrite your changes (y/n)? y
Updating dependencies: 100% (1/1), 0.6 MiB cached, done.
Result: 0
Register the engine installation…
Installing a bundled clang toolchain
Toolchain already installed skipping.

Target arch set to: x86_64-unknown-linux-gnu
Building ThirdParty libraries

If you don’t see SUCCESS message in the end, then building did not finish properly.
In that case, take a look into /home/rene/data1/unrealEngine/zip/UnrealEngine-4.27.0-release/Engine/Build/BatchFiles/Linux/BuildThirdParty.log for details.

No third party libs needed to be built locally

********** SUCCESS ****************
Setup successful.
rene@sparrow:~/data1/unrealEngine/zip/UnrealEngine-4.27.0-release$ ./GenerateProjectFiles.sh
Attempting to set up UE4 pretty printers for gdb (existing UE4Printers.py, if any, will be overwritten)…
updated UE4Printers.py
found necessary entries in ~/.gdbinit file, not changing it.

Setting up Unreal Engine 4 project files…

Fixing inconsistent case in filenames.
Setting up Mono
Generating data for project indexing… 100%
Generating data for project indexing… 0%Stacktrace:

/proc/self/maps:
00400000-00811000 r-xp 00000000 08:02 23200930 /home/rene/data1/unrealEngine/zip/UnrealEngine-4.27.0-release/Engine/Binaries/ThirdParty/Mono/Linux/bin/mono
00a10000-00a1c000 rw-p 00410000 08:02 23200930 /home/rene/data1/unrealEngine/zip/UnrealEngine-4.27.0-release/Engine/Binaries/ThirdParty/Mono/Linux/bin/mono
00a1c000-00a33000 rw-p 00000000 00:00 0
019c9000-027f6000 rw-p 00000000 00:00 0 [heap]
404c8000-4079d000 rwxp 00000000 00:00 0
41589000-41599000 rwxp 00000000 00:00 0
7fc00fc00000-7fc00fd00000 rw-p 00000000 00:00 0
7fc00fe00000-7fc00ff00000 rw-p 00000000 00:00 0
7fc010000000-7fc010100000 rw-p 00000000 00:00 0
7fc010200000-7fc010300000 rw-p 00000000 00:00 0
7fc010400000-7fc010500000 rw-p 00000000 00:00 0
7fc010600000-7fc010700000 rw-p 00000000 00:00 0
7fc010800000-7fc010900000 rw-p 00000000 00:00 0
7fc010a00000-7fc010b00000 rw-p 00000000 00:00 0
7fc010c00000-7fc010d00000 rw-p 00000000 00:00 0
7fc010e00000-7fc010f00000 rw-p 00000000 00:00 0
7fc011000000-7fc011100000 rw-p 00000000 00:00 0
7fc011200000-7fc011300000 rw-p 00000000 00:00 0
7fc011400000-7fc011500000 rw-p 00000000 00:00 0
7fc011600000-7fc011700000 rw-p 00000000 00:00 0
7fc011800000-7fc011900000 rw-p 00000000 00:00 0
7fc011a00000-7fc011b00000 rw-p 00000000 00:00 0
7fc011c00000-7fc011d00000 rw-p 00000000 00:00 0
7fc011e00000-7fc011f00000 rw-p 00000000 00:00 0
7fc012000000-7fc012100000 rw-p 00000000 00:00 0
malloc(): unsorted double linked list corrupted
./GenerateProjectFiles.sh: line 30: 9948 Aborted (core dumped) mono “$BASE_PATH/…/…/…/Binaries/DotNET/UnrealBuildTool.exe” -projectfiles “$@”

i may have a problem with the motherboard or cpu or RAM on the machine i used in my previous reply to this message.

trying a compile sequence on another, more stable machine now, and it’s looking good so far.

will let you know how it turns out…

I have same problem, also discussed (but not resolved) here:
https://answers.unrealengine.com/questions/1017417/view.html
It seems to be related in my case to a multithreading issue.
I managed to have 2 PC with different hardware but the same Debian Linux Bullseye installed and I can compile without errors on the oldest one, while I have a lot of random errors on my new Ryzen 9 3900X.
Forcing to compile with only 1 core at a time solved the problem and I’ve been able to build but it took too much time to be considered a solution.
I suppose that this output while building is a clue:

Ryzen 9 3900X has 12 physical cores and not 24 as stated in the output, maybe it has to do with the errors?

Anyway if anyone had any suggestions on how to solve the problem I would be very grateful.

Just change the owner for the folder and subfolders and run make again

sudo chown -R user:user UnrealEngine*