Problems with building Cesium and cesium-native from Source

I am trying to build Cesium 2.8.0 with UE 5.4
I was able to build cesium-native (GitHub - CesiumGS/cesium-native), but I have problems with building the whole cesium-unreal.

I followed the instructions from here: cesium-unreal/Documentation/developer-setup-linux.md at main · CesiumGS/cesium-unreal · GitHub

The problem I couldn’t resolve: the cmake command for building

cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="unreal-linux-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --target install

runs successfully, but I get a lot of messages like “error: no member named ‘make_task’ in namespace ‘async’” when trying to build it with UAT

./RunUAT.sh BuildPlugin -Plugin="$CESIUM_FOR_UNREAL_DIR/CesiumForUnreal.uplugin" -Package="$CESIUM_FOR_UNREAL_DIR/../packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux

And all of them refer to library async++. This library exists in cesium-unreal/Source/ThirdParty/include and /lib/.
Also I see that there is a line in cesium-unreal/extern/cesium-native/CMakeLists.txt:

find_package(Async++ CONFIG REQUIRED)

so if this package had not been found, there would be an error.

Inside cesium-unreal/extern/cesium-native/CesiumAsync/CMakeLists.txt there are lines:

target_link_libraries(CesiumAsync
    PUBLIC
        CesiumUtility
        Microsoft.GSL::GSL
        spdlog::spdlog spdlog::spdlog_header_only
        Async++
    PRIVATE
        unofficial::sqlite3::sqlite3
)

So, this library exists and being included to the target CesiumAsync.

I did a little search through CMakeCache.txt inside cesium-unreal/extern/build/ and found that there is a variable “Async++_DIR:PATH=/home/user/.ezvcpkg/2024.07.12/installed/x64-linux-release/share/async++”

Inside /home/user/.ezvcpkg/2024.07.12/installed/x64-linux-release/ there are include/, lib/ and share/ (with cmake configs) folders.

Why command

./RunUAT.sh BuildPlugin -Plugin="$CESIUM_FOR_UNREAL_DIR/CesiumForUnreal.uplugin" -Package="$CESIUM_FOR_UNREAL_DIR/../packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux

leads to these errors?

p.s. variable CESIUM_FOR_UNREAL_DIR is set to root of cesium-unreal

Also, I forgot one detail: I had to set cmake variable VCPKG_TRIPLET=x64-linux-release, because if not, there would be an error:

CMake Error at CMakeLists.txt:118 (message):
  Cannot guess an appropriate value for VCPKG_TRIPLET because the operating
  system is unknown.  Please set it manually.

so the whole cmake command inside cesium-unreal/extern was:
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="unreal-linux-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Debug -DVCPKG_TRIPLET=x64-linux-release

And also: I am running ubuntu 22.04

upd: I switched to the 2.7.0 version and 0.37.0 cesium-native, none of these errors didn’t appear.

But not I am facing another problem with linkage when trying to build my project where I use Cesium For Unreal:

ld.lld: error: undefined symbol: CesiumGeospatial::S2CellBoundingVolume::computeBoundingRegion(CesiumGeospatial::Ellipsoid const&) const
>>> referenced by Cesium3DTileset.cpp:522 (../Plugins/Marketplace/CesiumForUnreal/Source/CesiumRuntime/Private/Cesium3DTileset.cpp:522)

The whole message:

[2/5] Link (lld) libUnrealEditor-CesiumRuntime.so
ld.lld: error: undefined symbol: CesiumGeospatial::S2CellBoundingVolume::computeBoundingRegion(CesiumGeospatial::Ellipsoid const&) const
>>> referenced by Cesium3DTileset.cpp:522 (../Plugins/Marketplace/CesiumForUnreal/Source/CesiumRuntime/Private/Cesium3DTileset.cpp:522)
>>>               /home/stc/UnrealEngine/Engine/Plugins/Marketplace/CesiumForUnreal/Intermediate/Build/Linux/x64/UnrealEditor/Development/CesiumRuntime/Cesium3DTileset.cpp.o:(decltype(auto) std::__1::__variant_detail::__visitation::__base::__dispatcher<4ul>::__dispatch[abi:v15001]<std::__1::__variant_detail::__visitation::__variant::__value_visitor<ACesium3DTileset::OnFocusEditorViewportOnThis()::CalculateECEFCameraPosition>&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)0, CesiumGeometry::BoundingSphere, CesiumGeometry::OrientedBoundingBox, CesiumGeospatial::BoundingRegion, CesiumGeospatial::BoundingRegionWithLooseFittingHeights, CesiumGeospatial::S2CellBoundingVolume> const&>(std::__1::__variant_detail::__visitation::__variant::__value_visitor<ACesium3DTileset::OnFocusEditorViewportOnThis()::CalculateECEFCameraPosition>&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)0, CesiumGeometry::BoundingSphere, CesiumGeometry::OrientedBoundingBox, CesiumGeospatial::BoundingRegion, CesiumGeospatial::BoundingRegionWithLooseFittingHeights, CesiumGeospatial::S2CellBoundingVolume> const&))
>>> referenced by CalcBounds.cpp:78 (../Plugins/Marketplace/CesiumForUnreal/Source/CesiumRuntime/Private/CalcBounds.cpp:78)
>>>               /home/user/UnrealEngine/Engine/Plugins/Marketplace/CesiumForUnreal/Intermediate/Build/Linux/x64/UnrealEditor/Development/CesiumRuntime/CalcBounds.cpp.o:(CalcBoundsOperation::operator()(CesiumGeospatial::S2CellBoundingVolume const&) const)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

upd2: the second place with the same linker error is ad line 522 in Cesium3DTileset.cpp

Take a look at the Linux CI build script, which shows the exact steps we use to build the plugin on Linux.

The parameter values come from here:

I’m not sure exactly where you’re going wrong, but a guess is that it might be a result of using your system compiler to build cesium-native instead of Unreal’s own copy of clang.