In your second reply you are suggesting starting with the unreal-linux-from-windows-toolchain.cmake
and making our own unreal-linuxarm64-from-windows-toolchain.cmake
.
So after making the changes it would look like this:
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm64)
SET(CMAKE_SYSROOT $ENV{UNREAL_ENGINE_COMPILER_DIR})
SET(CMAKE_C_COMPILER $ENV{UNREAL_ENGINE_COMPILER_DIR}/bin/clang)
SET(CMAKE_CXX_COMPILER $ENV{UNREAL_ENGINE_COMPILER_DIR}/bin/clang++)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH on)
SET(CMAKE_POSITION_INDEPENDENT_CODE on)
set(CMAKE_C_COMPILER_TARGET aarch64-unknown-linux-gnueabi)
set(CMAKE_CXX_COMPILER_TARGET aarch64-unknown-linux-gnueabi)
SET(CMAKE_CXX_FLAGS “-nostdinc++ "-I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include" "-I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include/c++/v1" -target aarch64-unknown-linux-gnueabi”)
SET(CMAKE_C_FLAGS “-target aarch64-unknown-linux-gnueabi”)
search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
I keep the export like you said export UNREAL_ENGINE_COMPILER_DIR=$UNREAL_ENGINE_DIR/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v20_clang-13.0.1-centos7/aarch64-unknown-linux-gnueabi
and build on Ubuntu desktop following the developer-setup-linux.md ?
cd ~/dev/cesium-unreal/extern
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=“unreal-linuxarm64-from-windows-toolchain.cmake” -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --target install -j14
cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles
./RunUAT.sh BuildPlugin -Plugin=“$CESIUM_FOR_UNREAL_DIR/CesiumForUnreal.uplugin” -Package=“$CESIUM_FOR_UNREAL_DIR/…/packages/CesiumForUnreal” -CreateSubFolder -TargetPlatforms=LinuxArm64
Notice I use TargetPlatforms=LinuxArm64
Let me know if all the steps look good to you.
Also management here at work (I won’t mention names for obvious reasons) asked me if we could have you or anyone else on your team as a direct contact instead of using the forum for communication.
Thanks again for all your help!
Update from today
After doing all the above and building the last step errors with the following output:
Running AutomationTool…
Fixing inconsistent case in filenames.
Setting up Mono
Setting up bundled DotNet SDK
Start UAT Interactively: dotnet AutomationTool.dll BuildPlugin -Plugin=/home/sage/dev/cesium-unreal/CesiumForUnreal.uplugin -Package=/home/sage/dev/cesium-unreal/…/packages/CesiumForUnreal -CreateSubFolder -TargetPlatforms=LinuxArm64
/data/Unreal/UE5.1/Linux_Unreal_Engine_5.1.1/Engine/Build/BatchFiles/Linux/…/…/…/Binaries/ThirdParty/DotNet/6.0.302/linux/dotnet
Starting AutomationTool…
Parsing command line: BuildPlugin -Plugin=/home/sage/dev/cesium-unreal/CesiumForUnreal.uplugin -Package=/home/sage/dev/cesium-unreal/…/packages/CesiumForUnreal -CreateSubFolder -TargetPlatforms=LinuxArm64
Initializing script modules…
Total script module initialization time: 0.12 s.
Executing commands…
Copying 19312 file(s) using max 64 thread(s)
Reading plugin from /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/CesiumForUnreal.uplugin…
Building plugin for host platforms: Linux
Running: /data/Unreal/UE5.1/Linux_Unreal_Engine_5.1.1/Engine/Binaries/ThirdParty/DotNet/6.0.302/linux/dotnet “/data/Unreal/UE5.1/Linux_Unreal_Engine_5.1.1/Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll” UnrealEditor Linux Development -Project=/home/sage/dev/packages/CesiumForUnreal/HostProject/HostProject.uproject -plugin=/home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/CesiumForUnreal.uplugin -iwyu -noubtmakefiles -manifest=/home/sage/dev/packages/CesiumForUnreal/HostProject/Saved/Manifest-UnrealEditor-Linux-Development.xml -nohotreload -log=“/home/sage/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UnrealEditor-Linux-Development.txt”
Log file: /home/sage/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UnrealEditor-Linux-Development.txt
Parsing headers for UnrealEditor
Running Internal UnrealHeaderTool /home/sage/dev/packages/CesiumForUnreal/HostProject/HostProject.uproject /home/sage/dev/packages/CesiumForUnreal/HostProject/Intermediate/Build/Linux/B4D820EA/UnrealEditor/Development/UnrealEditor.uhtmanifest -WarningsAsErrors -installed
Total of 102 written
Reflection code generated for UnrealEditor in 3.2835322 seconds
------- Build details --------
Using toolchain located at ‘/data/Unreal/UE5.1/Linux_Unreal_Engine_5.1.1/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v20_clang-13.0.1-centos7/x86_64-unknown-linux-gnu’.
Using clang (/data/Unreal/UE5.1/Linux_Unreal_Engine_5.1.1/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v20_clang-13.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang++) version ‘clang version 13.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /data/Unreal/UE5.1/Linux_Unreal_Engine_5.1.1/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v20_clang-13.0.1-centos7/x86_64-unknown-linux-gnu/bin’ (string), 13 (major), 0 (minor), 1 (patch)
Using bundled libc++ standard C++ library.
Using lld linker
Using llvm-ar (/data/Unreal/UE5.1/Linux_Unreal_Engine_5.1.1/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v20_clang-13.0.1-centos7/x86_64-unknown-linux-gnu/bin/llvm-ar) version ‘LLVM (http://llvm.org/):
LLVM version 13.0.1
Optimized build.
Default target: x86_64-unknown-linux-gnu
Host CPU: skylake-avx512 (string)’
Using fast way to relink circularly dependent libraries (no FixDeps).
‘------------------------------’
Writing manifest to /home/sage/dev/packages/CesiumForUnreal/HostProject/Saved/Manifest-UnrealEditor-Linux-Development.xml
Building UnrealEditor…
Determining max actions to execute in parallel (20 physical cores, 20 logical cores)
Executing up to 20 processes, one per physical core
Building 12 actions with 12 processes…
[1/12] Compile PCH.CesiumRuntime.h
[2/12] Compile PCH.CesiumEditor.h
[3/12] Compile Module.CesiumRuntime.4_of_6.cpp
[4/12] Compile Module.CesiumRuntime.2_of_6.cpp
[5/12] Compile Module.CesiumRuntime.3_of_6.cpp
[6/12] Compile Module.CesiumRuntime.1_of_6.cpp
[7/12] Compile Module.CesiumRuntime.5_of_6.cpp
[8/12] Compile Module.CesiumEditor.cpp
[9/12] Compile Module.CesiumRuntime.6_of_6.cpp
[10/12] Link (lld) libUnrealEditor-CesiumRuntime.so
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libasync++.a(scheduler.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(BingMapsRasterOverlay.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(BoundingVolume.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(CreditSystem.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(DebugColorizeTilesRasterOverlay.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(GltfUtilities.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(IonRasterOverlay.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(RasterOverlay.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(RasterOverlayCollection.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(RasterOverlayTile.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(RasterizedPolygonsOverlay.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(RasterizedPolygonsTileExcluder.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(Tile.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(TileContent.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(TileID.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(TileMapServiceRasterOverlay.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(TileOcclusionRendererProxy.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(Tileset.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(ViewState.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: /home/sage/dev/packages/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/ThirdParty/lib/Linux-x64/libCesium3DTilesSelection.a(WebMapServiceRasterOverlay.cpp.o) is incompatible with elf64-x86-64
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[11/12] Link (lld) libUnrealEditor-CesiumEditor.so cancelled
[12/12] WriteMetadata UnrealEditor.target cancelled
Took 69.16592059999999s to run dotnet, ExitCode=6
UnrealBuildTool failed. See log for more details. (/home/sage/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UnrealEditor-Linux-Development.txt)
AutomationTool executed for 0h 1m 10s
AutomationTool exiting with ExitCode=6 (6)
RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 6