Build UnrealEngine on Linux, making it use less disk space! :)

Build UnrealEngine on Linux, making it use less disk space! :)

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:

No alt text provided for this image


I hope you liked this and that it have helped you somehow.

Take care! Stay home! Stay safe! Make games! :)

FIN


要查看或添加评论,请登录

Gabriel M.的更多文章

  • Docker 101

    Docker 101

    A (tiny) introduction to Docker. If you want to get your hands dirty with some Docker content, this quick introduction…

  • Building custom kernels for Linux + updating the system firmware.

    Building custom kernels for Linux + updating the system firmware.

    In this post I'll show you how you can replace your current Linux kernel with a new one built entirely from the…

  • Debian complained about missing firmware during installation? Add missing 'non-free' firmware to installation image! :)

    Debian complained about missing firmware during installation? Add missing 'non-free' firmware to installation image! :)

    If you have installed Debian, you might have faced the screen below: And probably got very frustrated, because your…

  • Using Traps in Bash Scripts

    Using Traps in Bash Scripts

    Imagine that you have a script to perform some critical operation, one that would render the system completely unusable…

    2 条评论
  • Safer Bash Scripting Tips

    Safer Bash Scripting Tips

    I hope you are all well and safe. As "stay safe" is the most used expression during this COVID-19 period, I thought it…

    1 条评论
  • Pointers and 2D-arrays in C

    Pointers and 2D-arrays in C

    When taking the Engineering or CS undergrad path, like 1+1 leads to 2 (let's keep it simple here, shall we?), students…

    2 条评论
  • Linux Kernel Inotify Subsystem

    Linux Kernel Inotify Subsystem

    When dealing with Unix-style filesystems there must be a data structure that is capable of describing an object from…

  • Linux File I/O

    Linux File I/O

    When using system calls for dealing with file I/O, open(), read(), write() and close() are the four functions used to…

  • Shifting bits in C

    Shifting bits in C

    Have you ever asked yourself how much memory space do you waste when writing your code? Sometimes you just need a…

  • Improving your Linux box security

    Improving your Linux box security

    Did you know that more than never, during these quarantine days, there is a lot more malicious activities undergoing…

社区洞察

其他会员也浏览了