Can't build Unreal Engine 4 on Ubuntu

Yes, 64 bit. I give up with building on Linux.

Try it on more time please?

Try this, don’t stray from what it says.
YOU DON’T HAVE TO DOWNLOAD THE SOURCE THE WAY IT SAYS!

Installation Steps:

Installing Dependencies:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys

echo “deb Index of /repo/debian wheezy main” | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

sudo apt-get update

sudo apt-get install mono-devel

sudo apt-get install mono-gmcs mono-xbuild mono-dmcs libmono-corlib4.0-cil libmono-system-data-datasetextensions4.0-cil libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang-3.3 libfreetype6-dev libsdl2-dev libgtk-3-dev libmono-microsoft-build-tasks-v4.0-4.0-cil xdg-user-dirs

Get The Source: (Just get it as a .ZIP from Github.)

git clone https://github.com/3dluvr/UnrealEngine.git

This will download around 500 MB or more

Now type, cd UnrealEngine

./Setup.sh

It will download additional third party libraries (~3GB) and prepare it for compile

Generate Makefiles:

find Engine/Source/Programs/AutomationTool -name “*Automation.csproj” -exec sed -i “s/ToolsVersion="11.0"/ToolsVersion="4.0"/g” “{}” ;

export MSBuildToolsVersion=4.0

./GenerateProjectFiles.sh

Edit makefile: (Or do this… make UE4Editor ARGS=-clean )

open Makefile from the UnrealEngine main folder with a text editor and put the following lines just before the .PHONY statement at bottom.
shaders-clean:
rm -rf Engine/Intermediate/Shaders Engine/Saved Engine/DerivedDataCache Engine/Intermediate/CachedAssetRegistry.bin

editor-clean:
rm -rf Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UE4Editor Engine/Binaries/Linux/libUE4Editor-* Engine/Binaries/Linux/UE4Editor

clean:
rm -f Engine/Binaries/Linux/Unreal* Engine/Binaries/Linux/UE*
Engine/Binaries/Linux/libUnreal* Engine/Binaries/Linux/libUE* Engine/Binaries/Linux/libSh*
Engine/Binaries/Linux/ShaderCompileWorker* Engine/Binaries/Linux/SlateViewer* Engine/Binaries/Linux/CrashReportClient*
rm -rf Engine/Intermediate/Build Engine/Binaries/Linux/HTML5 Engine/Binaries/Linux/Linux Engine/Binaries/Linux/Android Engine/Binaries/Linux/IOS Engine/Binaries/Linux/HTML5

make sure the indented section at the beginning of every line is a single tab not white space/s

Finally Build The Editor:

make SlateViewer ShaderCompileWorker UnrealLightmass UnrealPak UE4Editor

Have a powerfull PC (at least 8 GB RAM and >=2.5ghz processor) and wait, because it will take time to build.

Run The Editor:

cd Engine/Binaries/Linux/

./UE4Editor

For first run, it will start compiling shaders and it will take time as well, but you can close it without completing this compilation. Next time you run UE4 editor, it will start compiling the shaders from the position it was left.
Enjoy… Hopefully.

Problem:


$ sudo apt-get install mono-gmcs mono-xbuild mono-dmcs libmono-corlib4.0-cil libmono-system-data-datasetextensions4.0-cil libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang-3.3 libfreetype6-dev libsdl2-dev libgtk-3-dev libmono-microsoft-build-tasks-v4.0-4.0-cil xdg-user-dirs
Reading package lists… Done
Building dependency tree
Reading state information… Done
cmake is already the newest version.
xdg-user-dirs is already the newest version.
clang-3.3 is already the newest version.
dos2unix is already the newest version.
libfreetype6-dev is already the newest version.
libgtk-3-dev is already the newest version.
libmono-corlib4.0-cil is already the newest version.
libmono-microsoft-build-tasks-v4.0-4.0-cil is already the newest version.
libmono-system-data-datasetextensions4.0-cil is already the newest version.
libmono-system-management4.0-cil is already the newest version.
libmono-system-web-extensions4.0-cil is already the newest version.
libmono-system-xml-linq4.0-cil is already the newest version.
mono-dmcs is already the newest version.
mono-xbuild is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
mono-gmcs : Depends: mono-mcs (= 3.12.1-0xamarin1) but 4.0.4.1-0xamarin1 is to be installed
E: Unable to correct problems, you have held broken packages.

That is a Ubuntu 14.04 error…You may need to reinstall you’re OS.
Do you have any applications that run on both you’re Ubuntu’s?

That might be the cause of all you’re problems.

They are clear. 15.04 said that clang-3.3 is no installation candidate…

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming…

Try this, sudo apt-get install mono-mcs libgtk2.0-cil libgtksourceview2-2.0-cil monodevelop monodoc-base mono-tools-gui mono-complete
That’s to install all of mono. (Just in case.)

Try this again.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys

echo “deb Index of /repo/debian wheezy main” | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

sudo apt-get update

sudo apt-get install mono-devel

sudo apt-get install mono-gmcs mono-xbuild mono-dmcs libmono-corlib4.0-cil libmono-system-data-datasetextensions4.0-cil libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang-3.3 libfreetype6-dev libsdl2-dev libgtk-3-dev libmono-microsoft-build-tasks-v4.0-4.0-cil xdg-user-dirs

This leads to the same problem.

Ughh… What is going on inside that pc of yours?

Lets try this:
build-essential mono-gmcs mono-xbuild mono-dmcs libmono-corlib4.0-cil libmono-system-data-datasetextensions4.0-cil
libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang xdg-user-dirs

And hope that does it better.

Also, try this aswell.

sudo apt-get install build-essential mono-gmcs mono-xbuild mono-dmcs libmono-corlib4.0-cil libmono-system-data-datasetextensions4.0-cil
libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang-3.5 libfreetype6-dev libgtk-3-dev libmono-microsoft-build-tasks-v4.0-4.0-cil xdg-user-dirs

Doesn’t work:

0 upgraded, 40 newly installed, 0 to remove and 188 not upgraded.
Need to get 12,1 MB of archives.
After this operation, 54,9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Abort.

Hmm… This really seems to be an Ubuntu problem.
You said you had Fedora? Try building on that.

I tryed once, but there are too some problems. And according to forum: building on Fedora goes with some errors, but I don’t want use UE with hope that there will no surprises. I should use Windows.

I don’t want to force windows on you… (It’s not great.)
It doesn’t hurt to try building on fedora. My friend runs it fine on there. (It would never build on gentoo for me… That’s the evil one.)

If you can… Try installing Linux Mint.
It works fine on that.

hi all the first time i post here

i’m not experience but this is my trying
i was working on ubuntu and when trying to compiling ue4 on it - make more problems
now i’m working on linux mint 17 and compiling ue4 on it - and finally working

i have some issues linked to undo history … make it crash and stopping work

but now i’m trying to solve it

this is post for change your system to other like linux mint if you didn’t found any solve

I tried Linux Mint, no success.

This sounds like a hardware problem…

Is it possible to build on another computer not even related to the one you are using?

Something is going on inside of you’re PC right now. (You did this with a clean install right? No other things installed?)

I tried with two laptops, but on one of the laptops the latest version of Mint doesn’t work, so I couldn’t try Mint on both. They were clean.

I tried to build using clang-3.3 and MaxProcessorCount = 2, got this:

[714/714] FixDeps UE4Editor
Fixing libUE4Editor-Landscape.so
touch: setting times of ‘/home/ubuntu/Data/UnrealEngine-release/Engine/Binaries/Linux/libUE4Editor-Landscape.so’: Operation not permitted
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: /home/ubuntu/Data/UnrealEngine-release/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UE4Editor/Development/UE4Editor.link
Total build time: 10471.15 seconds
make: *** [UE4Editor] Error 5

I came across this same problem today with a Kismet cpp file and same clang error, building UE 4.12 on SteamOS brewmaster). And came across this thread searching the web.

I managed to get it to build by with:

make -j1

I think it was some kind of multiprocess issue with clang.

Just wanted to share in case someone else comes across this.

I also tried opening an project on ubuntu 18, but get the dlopen failed loading libUE4Editor.
@BukaKing u compile the engine or the project with -j1 ?