Build UnrealEngine on Linux, making it use less disk space! :)
Gabriel M.
Linux Systems Engineer | IT Infrastructure | Security | Virtualization | Automation | AI | C and Shell Scripting
If you are playing with the amazing Unreal Engine on your Linux box, you might have noticed that the final size after compilation is around 80GB (as stated by the documentation on the web). That's quite a lot of space, uh!? What if you could make it smaller and still be able to add any "missing component" you might bump into? Well, check this out:
I will not detail the installation process, because it is well documented all over the web and it is pretty straightforward. I'll just make some observations regarding the steps involved.
According to the documentation, all you need to do is to clone the desired version, then run ./Setup.sh , ./GenerateProjectFiles.sh and make. And that's really it! The engine will take a while (depending on your machine) on the first run, because it will compile the shaders.
How can you decrease the required disk space, when building it from sources? Just adapt the above steps to be more Linux targeted (and of course you can dig deeper and tune even more).
Let's try to exclude other platforms, consoles and devices from our build:
# Clone the Engine sources: git clone --single-branch --branch 4.22 https://github.com/EpicGames/UnrealEngine.git # Run Setup.sh, but excluding thing you won't need (or think you won't :P): ./Setup.sh -exclude=WinRT -exclude=winrt -exclude=Mac -exclude=mac -exclude=osx -exclude=osx64 -exclude=osx32 -exclude=Androi d -exclude=android -exclude=IOS -exclude=ios -exclude=TVOS -exclude=tvos -exclude=HTML5 -exclude=html5 -exclude=PS4 -exclude=XboxOne -exclude=Switch -exclude=Dingo -exclude=vs2015 # Generate the project files: ./GenerateProjectFiles.sh # And finally compile the Editor, the ShaderCompiler and the LightMass component, which will all bring their dependencies: make UE4Editor ShaderCompileWorker UnrealLightmass
And this is the final result:
[gabriel@blackstar (4.22) UnrealEngine]$ du -hs * ; du -hs . 36K CMakeLists.txt 34G Engine 2.7M FeaturePacks 4.0K GenerateProjectFiles.bat 4.0K GenerateProjectFiles.command 4.0K GenerateProjectFiles.sh 4.0K LICENSE.md 20K Makefile 12K README.md 829M Samples 4.0K Setup.bat 4.0K Setup.command 4.0K Setup.sh 563M Templates 268K UE4CodeCompletionFolders.txt 24K UE4CodeLitePreProcessor.txt 4.0K UE4.code-workspace 80K UE4Config.pri 32K UE4Defines.pri 4.0K UE4Games.uprojectdirs 1.2M UE4Header.pri 176K UE4Includes.pri 4.0K UE4.kdev4 20K UE4.pro 916K UE4Source.pri 352K UE4.workspace 43G .
As you can see, the final directory size is only 43G instead of 70G+
The engine, running after first launch:
I hope you liked this and that it have helped you somehow.
Take care! Stay home! Stay safe! Make games! :)
FIN