How to Cross-Compile for Linux in Unreal Engine 5

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ค. 2024
  • In this video, we go over how to cross-compile an Unreal Engine project for Linux from Windows by installing the Clang toolchain. We also had to consider edge cases such as making sure our version of the engine had all the necessary dependencies for Linux installed, having to regenerate project files for existing projects after getting the toolchain, and verifying that the LINUX_MULTIARCH_ROOT environment variable was set appropriately. To cap the tutorial off, we made sure our packaged game worked by testing it on the Windows Subsystem for Linux (WSL).
    ****IMPORTANT LINKS****
    Cross-Compiling Unreal Engine for Linux: docs.unrealengine.com/en-US/S...
    For more information on the Windows Subsystem for Linux (WSL): docs.microsoft.com/en-us/wind...
    ****IMPORTANT COMMANDS****
    %LINUX_MULTIARCH_ROOT%x86_64-unknown-linux-gnu\bin\clang++ -v
    ^Make sure that you have an environment variable called LINUX_MULTIARCH_ROOT and its value is the absolute path of the directory where the toolchain was installed
    wsl -l -o
    wsl --install -d [name-of-distro]
    wsl
    wslpath "[windows-directory-path]"
    cd "[unix-directory-path]"
    ls
    ./[name-of-project].sh -nullrhi
    Ctrl-c
    How to support the channel:
    Get a shirt or sweatshirt with free shipping (Use code "SHIP" at checkout): teespring.com/stores/flopperam
    Become a member: / @flopperam
    Support us on Patreon: / flopperam
    Donate to our PayPal: www.paypal.me/flopperam
    Sponsor us on Github: github.com/sponsors/chris-gong
    Social media links:
    Discord: / discord
    Twitter: / flopperam
    Instagram: / flopperam
    Facebook: / flopperam
    0:00 Installing the clang toolchain
    1:50 Things to consider
    2:45 Building & packaging a game for Linux
    3:38 Running the game on Windows Subsystem for Linux
    5:29 Outro
    #ue5 #linux #crosscompilation
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 57

  • @Zarrar2802
    @Zarrar2802 หลายเดือนก่อน +1

    I like how you put most of the important commands in the description as the Unreal page has been updated and doesn't contain the commands anymore. Thanks!

  • @ReubenAStern
    @ReubenAStern ปีที่แล้ว +1

    Thanks a lot man, I finally got my game compiling for Linux! If every Linux guy was as thorough as you I would have made so much more progress with Linux.

  • @RootsterAnon
    @RootsterAnon 2 ปีที่แล้ว +5

    Thank you, this was helpful!

  • @skanda2186
    @skanda2186 ปีที่แล้ว +2

    This solution worked for me. Make sure to restart your PC after installing Clang.
    Thank you for sharing.

  • @bioblazepayne
    @bioblazepayne 2 ปีที่แล้ว +2

    Love the new Intro

  • @Toasticuss
    @Toasticuss 4 หลายเดือนก่อน +1

    I was having an issue where it kept saying the SDK for Linux wasn't installed even though it was on Windows and I could see the environmental variable. A system reboot fixed it for me.

  • @SyafiqRokman
    @SyafiqRokman 10 หลายเดือนก่อน +1

    This helped. Thanks
    edit: If for some reason, you built UE from src, and cant see the Linux package option, try running your dev editor from VS

    • @AlphaSpaceDev
      @AlphaSpaceDev 2 หลายเดือนก่อน

      Yeah, this also fixed my issue after fixing first the Clang folder path and restarted Windows.

  • @marcusmuller9014
    @marcusmuller9014 11 วันที่ผ่านมา

    Thank you a lot, this helped! Regarding graphics output: Did you ever acutally make the game render using wsl2? I tried like everything....

    • @Flopperam
      @Flopperam  11 วันที่ผ่านมา

      I haven't but I'm not sure if that's possible. I could be wrong though

  • @zxc-lv6fz
    @zxc-lv6fz 14 วันที่ผ่านมา

    thx ,solved my problem

  • @JustaGameDev24
    @JustaGameDev24 2 ปีที่แล้ว +2

    you saved my life

  • @BrassBoii
    @BrassBoii 2 ปีที่แล้ว +2

    If anyone struggles with compiling after you've installed the latest toolchain, it's because UE5 need V17 clan 10.0.1 - It could seem like this video uses the absolute latest version of UE, maybe the main branch? - Anyways - massive amount of love you for making this video. Your channel is really helpful!

    • @Flopperam
      @Flopperam  2 ปีที่แล้ว

      Hey, thank you for the kind words. I am using the 5.0 branch, which supports the v19-11.0.1 toolchain, in this video but yes, the ue5 main branch, I believe atm, also supports that same version of the toolchain.

    • @Flopperam
      @Flopperam  2 ปีที่แล้ว

      Just wondering, are you using Unreal Engine 5 Early Access? Because yes, that version uses the v17-10.0.1 clang toolchain since ue5-ea is a fork of 4.26. I could see the very early/first commits of the 5.0 branch being parallel with 4.26 but most of the commits, especially the later ones, of 5.0 should be in parallel with 4.27, thereby supporting the v19-11.0.1 toolchain.

    • @BrassBoii
      @BrassBoii 2 ปีที่แล้ว

      Indeed i am using the early access build. And yes it's a 4.26 fork, i learned that after much struggle 😂

    • @BrassBoii
      @BrassBoii 2 ปีที่แล้ว

      Now i am kinda wondering about something. Do you have experience with Amazon gravitation servers for the builded linux server? If so - then please make a video about that topic cuz i am struggling to push the builded solution to a service with the correct settings 😂

    • @Flopperam
      @Flopperam  2 ปีที่แล้ว

      Hey, I would recommend looking at this blog post for more info on Graviton, aws.amazon.com/blogs/gametech/compiling-unreal-engine-4-dedicated-servers-for-aws-graviton-ec2-instances/, but it shouldn't be too bad. It's just that Graviton instances run on ARM CPUs so you need to package a Linux Aarch64 build instead of a x86-64 build for Unreal Engine. Other than that, it should be pretty straightforward, at least from what I gather from the blog post.

  • @blakedellinger5300
    @blakedellinger5300 ปีที่แล้ว +1

    I'm using UE5 source - I downloaded the latest clang as indicated by unreal (v20 13.0.1), however, linux is still not showing up as an option to package. Instead it is under "Platforms with no complied support". Does anyone know if this means I have to build the game again in VS code under the linux option?

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      You have to regenerate the project files and build the engine from source again for the Linux option to show up I believe.

    • @blakedellinger5300
      @blakedellinger5300 ปีที่แล้ว

      @@Flopperam thanks! I will try that

  • @Akashwade
    @Akashwade 2 ปีที่แล้ว +1

    can i run Unreal engine 5 on 16gb ram intel i5 6th gen 2.6 GHZ 240ssd plz tell me which Unreal engine version should i use ?

    • @Flopperam
      @Flopperam  2 ปีที่แล้ว

      Those specs should be fine, maybe a little slow, for ue5, also depends on the gpu.

  • @HBasch
    @HBasch ปีที่แล้ว

    thanks a lot for your video ! I'm getting this error though.. It seems impossible to understand.. I have toolchain v20 installed but when i try to package it says : "BUILD FAILED: AddBuildProductsFromManifest: C:\Binaries\Linux\JUD.debug was in manifest "C:\Intermediate\Build\Manifest.xml" but could not be found. I tried everything what could it be ? thanks a lot

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      Hey sorry for the late response but are you still getting this error?

    • @HBasch
      @HBasch ปีที่แล้ว

      @@Flopperam no thanks i found out what was happening !

    • @leohmedia1592
      @leohmedia1592 8 หลายเดือนก่อน

      @@HBasch Do you remember what you did haha ?

    • @HBasch
      @HBasch 8 หลายเดือนก่อน

      Damn sorry no... I don't even have an idea on what project this was about@@leohmedia1592 but ask @Flopperam

  • @pacrouge4429
    @pacrouge4429 ปีที่แล้ว +1

    For 5.0.3 there is no clang version related. Ive followed all the steps and I keep receiving error while I’m packaging for Linux, any clue ?

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      I'm not too sure. Are you using the 4.27 keychain? Also, what's the error?

    • @pacrouge4429
      @pacrouge4429 ปีที่แล้ว

      @@Flopperam I’m using UE 5.0.3, I use the the last tool chain available only for 5.0.2. This is the error : Platform Linux is not a valid platform to build

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      @@pacrouge4429 Is this occurring when packaging or building in Visual Studio?

    • @pacrouge4429
      @pacrouge4429 ปีที่แล้ว

      @@Flopperam It's occurring while I'm packaging on Unreal, on the documentation page, l've figured out that there is no clang version available for 5.0.3 yet.

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      @@pacrouge4429 Unreal 5.0.x is technically a fork of 4.27 so that toolchain should work. i know you said you followed the instructions so maybe these are dumb questions, but did you rebuild your engine after installing the toolchain? Are you using a source build version of Unreal? And did you rerun the Setup and GenerateProjectFiles scripts before rebuilding?

  • @squade4873
    @squade4873 ปีที่แล้ว

    This might be unrelated to the video but I'm getting an error claiming that an SDK for linux is not installed properly, does anyone know how to fix this?

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      At what timestamp of the video is this error occurring?

    • @squade4873
      @squade4873 ปีที่แล้ว

      @@Flopperam 3:22 , right after clicking Package Project. I'm on UE 5.0.3.

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      @@squade4873 Hmmm, did you download the engine from the Epic Games Launcher or from Github?

    • @squade4873
      @squade4873 ปีที่แล้ว

      @@Flopperam Epic Games. I also double checked if I had Linux checked on Target platforms.

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      @@squade4873 Could you try reinstalling the engine, maybe even regenerating the visual studio project files for the project, rebuild the project in Visual Studio, and then trying again?

  • @wdm2180
    @wdm2180 ปีที่แล้ว

    Should it work on linux?

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      Hey, are you asking about compiling on a Linux machine or will the cross-packaged game work on a linux machine?

    • @wdm2180
      @wdm2180 ปีที่แล้ว

      @@Flopperam crooss-package.
      How i know its when u make game on windows and linux sametime,am i right?

    • @Flopperam
      @Flopperam  ปีที่แล้ว

      That's a good question. Unfortunately, since there are so many Linux operating systems, the only real way of knowing is to test the packaged game on a Linux machine. Unreal let's you cross compile for two Linux architectures I believe, arm and x64.