Unreal engine linux compile

Compiling For Linux

Why cross-compilation Cross-compilation was chosen in order to make it easier for game developers (who tend to have a centric workflow on a platform that differs from the deployment target). At the.

Why cross-compilation

Cross-compilation was chosen in order to make it easier for game developers (who tend to have a centric workflow on a platform that differs from the deployment target). At the moment, this is only supported for Windows, Mac users currently have to resort to native compilation.

Platform Support for Cross-Compilation

Currently cross compilation from Windows is supported for Linux-x86_64 and Linux-ARM target platforms.

Getting the toolchain

There are now 2 toolchain binaries available for cross compiling from Windows. One for cross compiling to Linux-x86_64 platforms and another for cross compiling to Linux-ARM platforms.
The Linux-x86_64 cross compile toolchain binaries can be downloaded from
— v4 clang-3.5.0-based — for UE4 \System->Advanced system settings->Advanced->Environment variables) named LINUX_MULTIARCH_ROOT. The value should be the path to the clang v8 directory containing the multiple linux architecture directories (for example one being x86_64-unknown-linux-gnu and another arm-unknown-linux-gnueabihf). Make sure the new environment variable has been registered to the system / application (MSVC) by rebooting the machine or restarting the app at least before continuing to the build step.

clang v4-7

Add an environment variable (Control Panel->System->Advanced system settings->Advanced->Environment variables) named LINUX_ROOT, value of which is the absolute path to your toolchain, without trailing backslash:

File:Adding Windows Environment Variable.png

If you are using the Linux-ARM cross compile toolchain before running GenerateProjectFiles.bat below edit the following file in the UE4 source code:
. /UnrealEngine/Engine/Source/Programs/UnrealBuildTool/Linux/UEBuildLinux.cs
by commenting out the following line:
static private string DefaultArchitecture = «x86_64-unknown-linux-gnu»;
and un-commenting the linux-arm architecture line just below it:
//static private string DefaultArchitecture = «arm-unknown-linux-gnueabihf»;

After you made sure that variable is set, re-regenerate UE4 project files (using GenerateProjectFiles.bat) and restart Visual Studio. After this, you should have «Linux» available among Win32/Win64 configurations, and you should be able to cross-compile for it. Should but not always will. As of 4.17 you won’t have it on a source version of the engine for some reason. Just don’t trust this thing like I did and spend 5 minutes looking for it, just launch the editor and try packaging to linux again. At this point you are reading too much into this wiki page. Just download the toolkit, extract and set your environment variables. If this doesn’t work then that’s when you come back and read more.

Читайте также:  Посмотреть все открытые порты linux

You also need to rerun Setup.bat or . /UnrealEngine/Engine/Binaries/DotNET/GitDependencies.exe because that step will grab/copy libc++ stuff to . /UnrealEngine/Engine/Source/ThirdParty/Linux/LibCxx/. Otherwise, cross-compiling will fails with saying it cannot find standard C++ headers. If you haven’t explicitly defined and set an environment variable of UE4_LINUX_USE_LIBCXX to 0, cross-compiling will use libc++ headers/libraries in there by default instead of the one inside the clang toolchain.

For packaging for Linux platforms (both x86_64 and ARM) the CrashReportClient is also needed to be built for the Linux configuration in addition to the default UE4Game project.

Notice that you may want to (re)build the Editor for your platform to get Linux target modules built. They are built for your current platform (i.e. select Win64 in configuration), and they are needed so that Unreal Editor and Unreal Frontend know how to cook/package games for Linux.

Note: If packaging for Linux (see below) fails it may be necessary to explicitly build UnrealPak and ShaderCompileWorker for the host platform, which in this case is windows (Win32 or Win64). To do this right-click on each of this project in the solution explorer and execute the «Build» command.

Note: If starting UE4Editor fails with message about not able to find libfbxsdk.dll, this can be fixed by copying libfbxsdk.dll from . \UnrealEngine\Engine\Source\ThirdParty\FBX\2014.2.1\lib\vs2012\x64\release to the same location as the UE4Editor executable file where . \UnrealEngine is the top location of the UE4 source code. For Win32 systems use the file located under . \x86\release instead.

Packaging for Linux

From the editor

The easiest way to package a project is opening it in the editor and then using File->Package To->Linux (assuming that you have a cross-toolchain installed in the previous step and Linux target modules are built for the editor in question — if you don’t see Linux in the list, then it’s likely that one of the former is not true — see above). After some time (which depends on the project in question and is rather short for sample project) you will have game assets and binaries in the directory you chose to package to.

The details of the packaging process can be seen by clicking the «Show Output Log» link. If this process fails with error message «unable to find UnrealPak or ShaderCompileWorker» see above about building them for the host (windows) platform.

Scp or otherwise copy it to a target machine (mounting a Samba share — if you know how to do that — may be better if target machine is low on disk space, this also reduces iteration times), chmod +x the target executable (which will be located in LinuxNoEditor//Binaries/Linux/ directory) and run it.

Additional Step for Linux-ARM platforms

An additional step is required for the packaged project to be runnable on Linux-ARM platforms. The following has been verified using the SunTemple project packaged using Unreal-4.6 and executed on NVIDIA’s Jetson TK1 platform.

Читайте также:  Android sdk build tools linux

Assuming the packaged project is located at \Users\foo\SunTemple_Linux open the following location:
\Users\foo\SunTemple_Linux\LinuxNoEditor\Engine\Binaries\Linux
and replace libopenal.so.1 with the version from:
. \UnrealEngine\Engine\Source\ThirdParty\OpenAL\1.15.1\lib\Linux\arm-unknown-linux-gnueabihf\libopenal.so
where . \UnrealEngine is the location of the UE4 source code. Please be sure to rename libopenal.so to libopenal.so.1.

Now the project can be copied over to the target machine, chmod+x the target executable and run it as instructed above.

Источник

Linux Development Quickstart

Unreal Engine (UE) supports development on Linux devices using either builds created from source or pre-compiled, installed builds. This page provides instructions on how to set up Unreal Engine on Linux, including your development environment and build pipeline. When you finish this tutorial, you will be ready to develop applications in Unreal Engine using your Linux machine.

Unreal Engine is compatible with a variety of Linux distributions and IDEs, as long as they meet these minimum requirements:

Operating System

Any reasonable new Linux distro from CentOS 7.x and up

Linux Kernel Version

Additional Dependencies

We recommend your system meet the following standard so that Unreal Editor performs smoothly:

Recommended Development Hardware

Quad-core Intel or AMD, 2.5 GHz or faster

NVIDIA GeForce 960 GTX or Higher with latest NVIDIA binary drivers

RHI Version

The Vulkan rendering hardware interface (RHI) used on Linux is not friendly to low amounts of VRAM compared with other backends. We strongly recommend using a dedicated GPU with a high amount of VRAM.

To set up your development environment, we recommend the following software, which we test with most frequently:

Operating System

clang 13.0.1 (5.1), clang 15.0.1 (5.2)

Refer to the documentation for your Linux distribution or IDE for further information on how to set them up. While setting up your OS and hardware is outside the scope of this documentation, setting up your IDE to work with Unreal Engine is covered below.

2. Install Unreal Engine

You can set up Unreal Engine on Linux either by installing a pre-compiled build, or by building the engine from source.

2a. Download an Installed Build

The simplest option for running Unreal Engine is to use an Installed Build. To download and install one, follow these steps:

Unreal Engine on Linux supports precompiled installed builds as well as source code builds. For information about using source builds, refer to Building Unreal Engine from Source .

To use a precompiled build, follow these steps:

Log in or sign up

    Open the Unreal Engine for Linux page. It will prompt you to to create or sign into an Epic Games account. If you already have one, sign in to access the page. If you don’t have an account, click Sign Up to create one.

Choose how to sign in

You can sign up for an Epic Games account with your email, or with a supported social media or gaming platform account.

Читайте также:  Multi volume archive linux

Download UE

Download the .zip file containing the version of Unreal Engine that you need.

2b. Build Unreal Engine from Source

To install Unreal Engine from source, refer to Downloading Unreal Engine Source Code . Once you have compiled the engine, run Engine/Binaries/Linux/UnrealEditor from the Terminal to launch Unreal Editor.

3. Setting Up a New Project

Refer to the instructions in Creating a New Project in Unreal Engine for information on how to set up a new project. You don’t need a specific template or project type for the purposes of this tutorial, but you should make sure it has C++ enabled if you are setting up your environment for C++.

[Screenshot enabling the C++ setting)

4. Set Up Your Development Environment (C++)

If you are planning to develop C++ projects, you need to set up the Clang toolchain and an IDE to work with Unreal Engine. While we don’t require a specific IDE, we recommend using Visual Studio Code or Rider. This section provides instructions that are specific to Visual Studio Code, as it provides a common development environment for other operating systems as well.

  1. Open a Terminal and run the following command: Sudo apt install clang
  2. Locate your Unreal Engine install directory and open Build/BatchFiles/Linux , then run SetupToolchain.sh .
  3. Download and install VS Code as well as the official C / C++ extension pack and C# extension. These are required for reading the source code for both Unreal Engine and its Build Tools.
  4. Either open Unreal Editor, open your Editor Preferences, and set your Source Code editor to Visual Studio Code, or modify BaseEngine.ini to include the following:
 [/Script/SourceCodeAccess.SourceCodeAccessSettings] PreferredAccessor=VisualStudioCode

For information about configuring VS Code with IntelliSense and other helpful utilities, see Setting Up VS Code for Unreal Engine .

5. Build a Project

Now that your environment is fully set up, you should run a test build of your project to ensure your workflow is fully functioning.

5a. Build a Project In Unreal Editor

Open your project in Unreal Editor, then click the Platforms dropdown and click Linux > Package Project. If your system is configured correctly, Unreal Engine will build, cook, and package your project.

5b. Build a Project Through the Command Line

To build a project through the Command Line, use the RunUAT script’s BuildCookRun command detailed in the Build Operations guide. The following is an example of a working BuildCookRun command:

 [UE Root Directory]/RunUAT BuildCookRun -Build -Cook -Stage -Package -Run -Project=[ProjectName]

Alternatively, you can use the Turnkey command line to start the same process.

 [UE Root Directory]/RunUAT Turnkey -command=ExecuteBuild -platform=Linux -Project=[ProjectName]

Normally, you need to use RunUAT from your Unreal Engine source directory. To make this command simpler to run, define a $UE_ROOT environment variable. This makes it possible to use RunUAT with a command such as $UE_ROOT/RunUAT BuildCookRun instead of providing the entire path to the RunUAT script.

Источник

Оцените статью
Adblock
detector