Can't compile UE4 on Ubuntu

Hi everyone

I’m compiling Unreal Engine 4 for Linux under Ubuntu 16.04 x64. Until now all steps were successful but now I’m trapped.

Yesterday I started installing dependences:


juanke234@juanke234-GA-MA74GMT-S2:~$ sudo apt 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 xdg-user-dirs 
[sudo] password for juanke234: 
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
El paquete libmono-corlib4.0-cil no está disponible, pero algún otro paquete hace referencia
a él. Esto puede significar que el paquete falta, está obsoleto o sólo se
encuentra disponible desde alguna otra fuente
Sin embargo, los siguientes paquetes lo reemplazan:
  mono-reference-assemblies-4.0 mono-devel

El paquete mono-gmcs no está disponible, pero algún otro paquete hace referencia
a él. Esto puede significar que el paquete falta, está obsoleto o sólo se
encuentra disponible desde alguna otra fuente
Sin embargo, los siguientes paquetes lo reemplazan:
  mono-xbuild mono-mcs mono-devel

E: El paquete «mono-gmcs» no tiene un candidato para la instalación
E: El paquete «libmono-corlib4.0-cil» no tiene un candidato para la instalación

But two dependences (2 last lines) were not able to install, so I didn’t install it.
I ran the following commands with success:


{{GitHub part...}}
cd UnrealEngine
./Setup.sh
./GenerateProjectFiles.sh

Later, I ran the [FONT=courier new]make command. I had to leave home, so I though UE4 would be compiled hours later. When I came, the PC hanged at middle of the process so I shutdown it (could this corrupt some files of UE compiling?).

It was later so today I restarted the compiling, but now it gave an error:


juanke234@juanke234-GA-MA74GMT-S2:~/UnrealEngine$ make
bash "/home/juanke234/UnrealEngine"/Engine/Build/BatchFiles/Linux/Build.sh CrashReportClient Linux Shipping  
Building CrashReportClient...
Using clang version '3.5.2' (string), 3 (major), 5 (minor), 2 (patch)
Target is up to date
bash "/home/juanke234/UnrealEngine"/Engine/Build/BatchFiles/Linux/Build.sh ShaderCompileWorker Linux Development  
Building ShaderCompileWorker...
Using clang version '3.5.2' (string), 3 (major), 5 (minor), 2 (patch)
Target is up to date
bash "/home/juanke234/UnrealEngine"/Engine/Build/BatchFiles/Linux/Build.sh UnrealPak Linux Development  
Building UnrealPak...
Using clang version '3.5.2' (string), 3 (major), 5 (minor), 2 (patch)
Target is up to date
bash "/home/juanke234/UnrealEngine"/Engine/Build/BatchFiles/Linux/Build.sh UnrealLightmass Linux Development  
Building UnrealLightmass...
Using clang version '3.5.2' (string), 3 (major), 5 (minor), 2 (patch)
Target is up to date
bash "/home/juanke234/UnrealEngine"/Engine/Build/BatchFiles/Linux/Build.sh UnrealFrontend Linux Development  
Building UnrealFrontend...
Using clang version '3.5.2' (string), 3 (major), 5 (minor), 2 (patch)
Target is up to date
bash "/home/juanke234/UnrealEngine"/Engine/Build/BatchFiles/Linux/Build.sh UE4Editor Linux Development  
Building UE4Editor...
Using clang version '3.5.2' (string), 3 (major), 5 (minor), 2 (patch)
Performing 194 actions (2 in parallel)
[1/194] Link libUE4Editor-UnrealEd.so
/home/juanke234/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/UnrealEd/Module.UnrealEd.16_of_21.cpp.o: file not recognized: No se reconoce el formato del fichero
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: UBT ERROR: Failed to produce item: /home/juanke234/UnrealEngine/Engine/Binaries/Linux/libUE4Editor-UnrealEd.so
Total build time: 12,09 seconds
Makefile:188: fallo en las instrucciones para el objetivo 'UE4Editor'
make: *** [UE4Editor] Error 5
juanke234@juanke234-GA-MA74GMT-S2:~/UnrealEngine$ 


Complete log in HERE

What can be happening? Could the forced shutdown corrupt the files for compiling? Or can be produced by the missing dependences?

Regards
Kevin

Which branch are you building, release or master?

The two lines about libmono-corlib4.0-cil and mono-gcms look familiar, I wouldn’t worry about them. I believe they’re obsolete nowadays and no longer needed. What confuses me is that you’re using Ubuntu 16.04 but it’s telling you your Clang version is 3.5.2. My Ubuntu 16.04 installation has Clang 3.8 and I’m 99% sure I didn’t install it manually.

If you run ‘clang --version’, what do you get? If it’s 3.5.2, try installing 3.8 by following these instructions. If it’s 3.8 (IMO more likely), then I think the build script is failing to recognize your Clang and/or Ubuntu version. Try a fresh checkout of master, they added a few Clang 3.8 related changes two days ago.

Hi Mattiwatti

I downloaded UE4 through* [FONT=courier new]git clone -b 4.12 https://github.com/EpicGames/UnrealEngine.git* so I don’t know (it should be 4.12), but at the page it shows [FONT=courier new]release.
Meanwhile I’m downloading [FONT=courier new]master branch from GitHub, not trough Terminal.
If this gets better or worse I’ll update this.

The tutorial you linked doesn’t work, but I tried to install [FONT=courier new]clang-3.8 trough [FONT=courier new]apt and Ubuntu says it’s already installed.
Your **[FONT=courier new]*clang --version ***reports me:


Ubuntu clang version 3.5.2-3ubuntu1 (tags/RELEASE_352/final) (based on LLVM 3.5.2)
Target: x86_64-pc-linux-gnu
Thread model: posix

So for now Clang 3.8 seems useless

Update:
I downloaded, installed and compiled Unreal Engine 4 successfully.
As Mattiwatti recommended, I used [FONT=courier new]master branch to compile. About [FONT=courier new]clang --version, I had 3.5.2 but after doing an [FONT=courier new]sudo apt clang it changed to 3.8.0. It was strange but worked.
About the compiling, it took some hours but without errors (1h to download, 3.5h to compile).
After finished the compiling, I executed UE4 and:

http://jk24.netne.net/Fotos/Captura%20de%20pantalla%20de%202016-06-23%2020-08-34.png

So this problem can be marked as solved. Thanks Mattiwatti for helping me.

Regards
Kevin

Cool, glad to hear it!

Yeah the compilation can take a while, fortunately you don’t have to do it often after the initial build (only on engine upgrades). Most of the time you’ll be compiling 5-20 files at most after a change.