Build of UE4Editor on Ubuntu 18.04 fails

My system:

  • i7 8700
  • GTX 1070 ti
  • 32 GB Ram (2x 16)
  • Kubuntu 18.04 (up to date)

I’ve followed the guide (Linux Game Development in Unreal Engine | Unreal Engine 5.1 Documentation) and everything worked fine before “make”. But every time when I try to “make”, I get this error multiple times on different steps:

clang++: error: unable to execute command: Segmentation fault (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 6.0.1 (tags/RELEASE_601/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Sometimes it occurs many times in a row, sometimes very early (first 200 of 1684), sometimes quite late (~700). The make process doesn’t stop then, but fails and stops at a later stage, most times with an error like “Failed to produce item …”. I’ve tried using a local version of clang (5.0.1 and 6.0.0) but same result. My computer is new, but could it be a RAM failure? I haven’t done a memtest yet. Do you have any ideas?


edit: works now, see my comment below

I have a very similar system I7 8700, 1080 Ti Ubuntu 18.04 and have been building Unreal Engine on Linux since 4.17.
When first attempted 4.21 build my system reliably crashed somewhere in the big build stage similar to your description.
What did was to disable hyperthreading (you can also try reducing the number of parallel compile jobs - theres an answer on this hub about which Unreal build parameter to change) then it compiles reliably.
It seems if you really are running the processors hard hyperthreading is not good - at least under Linux.
I disabled hyperthreading as also having issues with games running under wine also crashing - and this appears to be another known hyperthreading issue.

I’ve tried reducing the number of compile jobs now with setting MaxProcessorCount to 4 in Engine/Saved/UnrealBuildTool/BuildConfiguration.xml.
But error occurs again. I’ve tried with 1 processor too, but then the error occurred even earlier. Gonna try with disabled hyperthreading but doubt that’ll change anything since I’ve tried it with 1.

only other change I have is my system clang is 5.0.1 - but you tried that - maybe try that with reduced processors.
Ive built Unreal Engine multiple times and multiple versions (4.20.3,4.18.3) since then and all worked smoothly following the Linux build instructions with hyper threading disabled.

Ok, it works now. I don’t really know what fixed it now though. I disabled hyperthreading and built it with 2 processors, but still no success. With system clang the build crashed before UE4Editor. I tried it again with bundled clang, still those errors. However, I did another “make” then and the 68 failed steps could be compiled. Starting the editor resulted in a crash again, but was successful after a reboot. The Editor is now running. Yet I’m very afraid of applying any updates and having to rebuild it :frowning:
Anyway, thanks libhack! Although I’m not sure if it was only cause of hyperthreading.

I would say UE seems very sensitive to uncleaned source - I think Ive learned to eg do a fresh clone when doing a rebuild - theres no good make clean - or move the .git directory from the current failed build into a new directory and do a git checkout --hard release (or whatever version you want) - you will need to redo Setup.sh etc
I just noticed for 4.21 Im using the bundled clang not system - for 4.18 UE4 is explicitly using clang 3.9 - I think they bundle clang now to ensure a known working clang for UE4 is used.

oops - that should be git reset --hard … sorry