From 911324fcc381e35d09ae736b0ea24fa38ba6025d Mon Sep 17 00:00:00 2001 From: Russ Webber Date: Tue, 22 Feb 2022 16:18:21 +1100 Subject: [PATCH 1/3] fix: compile on Ubuntu 21.10 and Unreal 4.27.2 Work for ROS2 UE4 Camera Pub [sc-2974] --- Unreal/Plugins/AirSim/Source/AirSim.Build.cs | 13 +++++++------ build.sh | 6 +++--- cmake/cmake-modules/CommonSetup.cmake | 4 ++-- setup.sh | 12 ++++++------ 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Unreal/Plugins/AirSim/Source/AirSim.Build.cs b/Unreal/Plugins/AirSim/Source/AirSim.Build.cs index 17024a35b6..f27b8e7ba7 100644 --- a/Unreal/Plugins/AirSim/Source/AirSim.Build.cs +++ b/Unreal/Plugins/AirSim/Source/AirSim.Build.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using UnrealBuildTool; +using System; using System.IO; public class AirSim : ModuleRules @@ -105,12 +106,12 @@ private void AddOSLibDependencies(ReadOnlyTargetRules Target) PublicAdditionalLibraries.Add("dxguid.lib"); } - if (Target.Platform == UnrealTargetPlatform.Linux) - { - // needed when packaging - PublicAdditionalLibraries.Add("stdc++"); - PublicAdditionalLibraries.Add("supc++"); - } + if (Target.Platform == UnrealTargetPlatform.Linux) + { + // needed when packaging + PublicAdditionalLibraries.Add("stdc++"); + PublicAdditionalLibraries.Add("supc++"); + } } static void CopyFileIfNewer(string srcFilePath, string destFolder) diff --git a/build.sh b/build.sh index 96aeaf07b6..48842430a5 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/bin/bash # get path of current script: https://stackoverflow.com/a/39340259/207661 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -62,8 +62,8 @@ else export CC="gcc-8" export CXX="g++-8" else - export CC="clang-8" - export CXX="clang++-8" + export CC="clang-11" + export CXX="clang++-11" fi fi diff --git a/cmake/cmake-modules/CommonSetup.cmake b/cmake/cmake-modules/CommonSetup.cmake index 11d0c9bcb2..f814b18fca 100644 --- a/cmake/cmake-modules/CommonSetup.cmake +++ b/cmake/cmake-modules/CommonSetup.cmake @@ -59,9 +59,9 @@ macro(CommonSetup) if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") set(CMAKE_CXX_FLAGS "-stdlib=libc++ -Wno-documentation -Wno-unknown-warning-option ${CMAKE_CXX_FLAGS}") find_package(LLVM REQUIRED CONFIG) - set(CXX_EXP_LIB "-L${LLVM_LIBRARY_DIRS} -lc++fs -ferror-limit=10") + set(CXX_EXP_LIB "-L${LLVM_LIBRARY_DIRS} -ferror-limit=10") else() - set(CXX_EXP_LIB "-lstdc++fs -fmax-errors=10 -Wnoexcept -Wstrict-null-sentinel") + set(CXX_EXP_LIB "-fmax-errors=10 -Wnoexcept -Wstrict-null-sentinel") endif () endif () diff --git a/setup.sh b/setup.sh index e01a8c0dd6..3c32af67b2 100755 --- a/setup.sh +++ b/setup.sh @@ -38,17 +38,17 @@ else #linux software-properties-common \ wget \ libvulkan1 \ - vulkan-utils + vulkan-tools #install clang and build tools VERSION=$(lsb_release -rs | cut -d. -f1) # Since Ubuntu 17 clang is part of the core repository # See https://packages.ubuntu.com/search?keywords=clang-8 - if [ "$VERSION" -lt "17" ]; then - wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-get update - fi - sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev + # if [ "$VERSION" -lt "17" ]; then + # wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + # sudo apt-get update + # fi + sudo apt-get install -y clang-11 clang++-11 libc++-11-dev libc++abi-11-dev fi if ! which cmake; then From 9fd7576044721c39673c2f759509e34550c6ed73 Mon Sep 17 00:00:00 2001 From: Russ Webber Date: Mon, 28 Feb 2022 15:06:45 +1100 Subject: [PATCH 2/3] fix: export the UnrealImageCapture class --- Unreal/Plugins/AirSim/Source/AirSim.Build.cs | 4 ++-- Unreal/Plugins/AirSim/Source/UnrealImageCapture.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Unreal/Plugins/AirSim/Source/AirSim.Build.cs b/Unreal/Plugins/AirSim/Source/AirSim.Build.cs index f27b8e7ba7..40dd839af3 100644 --- a/Unreal/Plugins/AirSim/Source/AirSim.Build.cs +++ b/Unreal/Plugins/AirSim/Source/AirSim.Build.cs @@ -109,8 +109,8 @@ private void AddOSLibDependencies(ReadOnlyTargetRules Target) if (Target.Platform == UnrealTargetPlatform.Linux) { // needed when packaging - PublicAdditionalLibraries.Add("stdc++"); - PublicAdditionalLibraries.Add("supc++"); + // PublicAdditionalLibraries.Add("stdc++"); + // PublicAdditionalLibraries.Add("supc++"); } } diff --git a/Unreal/Plugins/AirSim/Source/UnrealImageCapture.h b/Unreal/Plugins/AirSim/Source/UnrealImageCapture.h index 07d6df8944..7320c6479c 100644 --- a/Unreal/Plugins/AirSim/Source/UnrealImageCapture.h +++ b/Unreal/Plugins/AirSim/Source/UnrealImageCapture.h @@ -5,7 +5,7 @@ #include "common/ImageCaptureBase.hpp" #include "common/common_utils/UniqueValueMap.hpp" -class UnrealImageCapture : public msr::airlib::ImageCaptureBase +class AIRSIM_API UnrealImageCapture : public msr::airlib::ImageCaptureBase { public: typedef msr::airlib::ImageCaptureBase::ImageType ImageType; From 3d2346f3fe75c455c55072fadb144f4fe974601a Mon Sep 17 00:00:00 2001 From: zimmy87 Date: Wed, 8 Jun 2022 09:11:50 -0700 Subject: [PATCH 3/3] respond to CR feedback --- .github/workflows/test_ubuntu.yml | 2 +- Unreal/Plugins/AirSim/Source/AirSim.Build.cs | 7 ------- setup.sh | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test_ubuntu.yml b/.github/workflows/test_ubuntu.yml index 64250abe60..38e0517956 100644 --- a/.github/workflows/test_ubuntu.yml +++ b/.github/workflows/test_ubuntu.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-18.04, ubuntu-20.04, ubuntu-21.10] steps: - uses: actions/checkout@v2 diff --git a/Unreal/Plugins/AirSim/Source/AirSim.Build.cs b/Unreal/Plugins/AirSim/Source/AirSim.Build.cs index 40dd839af3..22958a1964 100644 --- a/Unreal/Plugins/AirSim/Source/AirSim.Build.cs +++ b/Unreal/Plugins/AirSim/Source/AirSim.Build.cs @@ -105,13 +105,6 @@ private void AddOSLibDependencies(ReadOnlyTargetRules Target) PublicAdditionalLibraries.Add("dinput8.lib"); PublicAdditionalLibraries.Add("dxguid.lib"); } - - if (Target.Platform == UnrealTargetPlatform.Linux) - { - // needed when packaging - // PublicAdditionalLibraries.Add("stdc++"); - // PublicAdditionalLibraries.Add("supc++"); - } } static void CopyFileIfNewer(string srcFilePath, string destFolder) diff --git a/setup.sh b/setup.sh index 3c32af67b2..b0ab870708 100755 --- a/setup.sh +++ b/setup.sh @@ -38,7 +38,7 @@ else #linux software-properties-common \ wget \ libvulkan1 \ - vulkan-tools + vulkan-utils #install clang and build tools VERSION=$(lsb_release -rs | cut -d. -f1)