From 776f32156efb3a22fc22cfbe707ef30496ed08f8 Mon Sep 17 00:00:00 2001 From: Fabian Oboril Date: Sat, 11 Nov 2023 15:25:54 +0100 Subject: [PATCH] Enable Ubuntu 22.04 builds * Updated github workflow to still build on 18.04 * Added support for clang-10 on 20.04 * Added support for gcc-11 and clang-14 on 22.04 --- .github/workflows/build_test.yml | 58 ++++++++++++++++++- .github/workflows/install_dependencies.sh | 22 ++++--- .github/workflows/wheels.yml | 6 +- .github/workflows/wheels/docker/Dockerfile | 4 +- .gitmodules | 3 + README.md | 19 +++--- .../tests/opendrive/OpenDriveAccessTests.cpp | 6 +- colcon.meta | 2 +- colcon_python.meta | 2 +- dependencies/PROJ4 | 1 + tools/map_maker/CMakeLists.txt | 2 +- .../ad/map/maker/geometry/Polyline2d.hpp | 1 + .../ad/map/maker/map_data/Intersection.hpp | 1 - .../include/ad/map/maker/map_data/Road.hpp | 1 - .../map_data/src/BigIntersectionGenerator.cpp | 2 +- 15 files changed, 96 insertions(+), 34 deletions(-) create mode 160000 dependencies/PROJ4 diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 63d994f38..5e9f55f8f 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -13,7 +13,7 @@ env: jobs: ubuntu18job: name: Ubuntu 18.04 - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: @@ -44,9 +44,16 @@ jobs: CXX: /usr/bin/clang++-8 PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6" + container: + image: ubuntu:18.04 + steps: - - uses: actions/checkout@v2 + - name: Install base packages + run: apt update && apt install -y git sudo + + - uses: actions/checkout@v1 with: + fetch-depth: 1 submodules: true - name: Install Dependencies @@ -59,10 +66,11 @@ jobs: EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }} PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }} run: | - sudo apt-get install ${EXTRA_PACKAGES} + sudo apt-get install -y ${EXTRA_PACKAGES} rm -rf log build install eval CC=${CC} CXX=${CXX} ${BUILDCMD} + ubuntu20job: name: Ubuntu 20.04 runs-on: ubuntu-20.04 @@ -75,6 +83,11 @@ jobs: CC: "" CXX: "" PYTHON_BINDING_VERSION: "3.8" + - compiler: clang10 + EXTRA_PACKAGES: clang-10 + CC: /usr/bin/clang-10 + CXX: /usr/bin/clang++-10 + PYTHON_BINDING_VERSION: "3.8" steps: - uses: actions/checkout@v2 @@ -94,3 +107,42 @@ jobs: sudo apt-get install ${EXTRA_PACKAGES} rm -rf log build install eval CC=${CC} CXX=${CXX} ${BUILDCMD} + + + + ubuntu22job: + name: Ubuntu 22.04 + runs-on: ubuntu-22.04 + + strategy: + matrix: + include: + - compiler: gcc11 + EXTRA_PACKAGES: "" + CC: "" + CXX: "" + PYTHON_BINDING_VERSION: "3.10" + - compiler: clang14 + EXTRA_PACKAGES: clang-14 + CC: /usr/bin/clang-14 + CXX: /usr/bin/clang++-14 + PYTHON_BINDING_VERSION: "3.10" + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install Dependencies + run: bash .github/workflows/install_dependencies.sh + + - name: Build and Test + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }} + PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }} + run: | + sudo apt-get install ${EXTRA_PACKAGES} + rm -rf log build install + eval CC=${CC} CXX=${CXX} ${BUILDCMD} diff --git a/.github/workflows/install_dependencies.sh b/.github/workflows/install_dependencies.sh index 7106776c2..144bb22d9 100644 --- a/.github/workflows/install_dependencies.sh +++ b/.github/workflows/install_dependencies.sh @@ -1,18 +1,24 @@ #!/bin/bash -sudo add-apt-repository ppa:ubuntu-toolchain-r/test +python3_pkgs="libpython3-dev python3 python3-pip python3-setuptools python3-wheel python-is-python3" +python2_pkgs="libpython-dev python python-pip python-wheel python-setuptools" +other_pkgs="build-essential castxml cmake libboost-all-dev libgtest-dev liblapacke-dev libopenblas-dev libpugixml-dev sqlite3" + sudo apt-get update -sudo apt-get install -y --no-install-recommends build-essential castxml cmake libboost-all-dev libgtest-dev liblapacke-dev libopenblas-dev libproj-dev libpugixml-dev libpython3-dev python python-setuptools python3 python3-pip python3-setuptools python3-wheel +sudo apt-get install -y lsb-core -if [ `lsb_release -a | grep Release | grep 20.04 | wc -l` == 1 ]; then - sudo apt-get install -y --no-install-recommends python-is-python3 -else - sudo apt-get install -y --no-install-recommends python-pip python-wheel +if [ `lsb_release -a | grep Release | grep 18.04 | wc -l` == 1 ]; then + sudo add-apt-repository ppa:ubuntu-toolchain-r/test fi + +sudo apt-get update +sudo apt-get install -y --no-install-recommends ${other_pkgs} ${python3_pkgs} + sudo pip3 install --upgrade setuptools==51.1.2 sudo pip3 install colcon-common-extensions xmlrunner pygccxml pyplusplus -if [ `lsb_release -a | grep Release | grep 20.04 | wc -l` != 1 ]; then +if [ `lsb_release -a | grep Release | grep 18.04 | wc -l` == 1 ]; then + sudo apt-get install -y --no-install-recommends ${python2_pkgs} sudo pip2 install --upgrade setuptools==41.1.0 - sudo pip2 install pygccxml pyplusplus xmlrunner + sudo pip2 install pygccxml==1.9.1 pyplusplus xmlrunner fi diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 26f097423..c7e83dd03 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -10,7 +10,7 @@ on: jobs: wheels: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: python_binding_version: [2.7, 3.6, 3.7, 3.8] @@ -25,12 +25,10 @@ jobs: with: fetch-depth: 1 submodules: true - - name: Prepare PROJ - run: | - git clone --depth=1 -b 4.9.3 https://github.com/OSGeo/PROJ.git dependencies/PROJ - name: Build wheels shell: bash run: | + apt update && apt install sqlite3 -y colcon build --packages-select PROJ4 --event-handlers console_direct+ --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE=ON source install/setup.bash colcon build --packages-up-to ad_map_access --meta colcon_python.meta --event-handlers console_direct+ --cmake-args -DPYTHON_BINDING_VERSION=${PYTHON_BINDING_VERSION} diff --git a/.github/workflows/wheels/docker/Dockerfile b/.github/workflows/wheels/docker/Dockerfile index 7bf88cb40..ec8fc25b0 100644 --- a/.github/workflows/wheels/docker/Dockerfile +++ b/.github/workflows/wheels/docker/Dockerfile @@ -15,9 +15,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ wget \ autoconf \ automake \ + sqlite3 \ castxml \ - libpugixml-dev \ - libproj-dev && \ + libpugixml-dev && \ rm -rf /var/lib/apt/lists/* RUN \ diff --git a/.gitmodules b/.gitmodules index 722457035..a5319a6c2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "dependencies/odrSpiral"] path = dependencies/odrSpiral url = https://github.com/DLR-TS/odrSpiral +[submodule "dependencies/PROJ4"] + path = dependencies/PROJ4 + url = https://github.com/OSGeo/PROJ.git diff --git a/README.md b/README.md index fa21786e1..cd770a74b 100644 --- a/README.md +++ b/README.md @@ -67,16 +67,19 @@ To download the library, you may run: ``` #### Supported systems -Development systems are Ubuntu 18.04 and Ubuntu 20.04. +Development systems are Ubuntu 18.04, Ubuntu 20.04 and Ubuntu 22.04 Following compiler combinations are [tested continously](https://github.com/carla-simulator/map/blob/master/.travis.yml): -| | Ubuntu 18.04 | Ubuntu 20.04 | -|:---------------:|:------------:|:------------:| -| Clang 7 | x | | -| Clang 8 | x | | -| GCC 7 | x | | -| GCC 8 | x | | -| GCC 9 | x | x | +| | Ubuntu 18.04 | Ubuntu 20.04 | Ubuntu 22.04 | +|:---------------:|:------------:|:------------:|:------------:| +| Clang 7 | x | | | +| Clang 8 | x | | | +| GCC 7 | x | | | +| GCC 8 | x | | | +| GCC 9 | x | x | | +| Clang 10 | | x | | +| GCC 11 | | | x | +| Clang 14 | | | x | Important: cmake is required to be at least version 3.5! diff --git a/ad_map_access/tests/opendrive/OpenDriveAccessTests.cpp b/ad_map_access/tests/opendrive/OpenDriveAccessTests.cpp index 001e4c7cf..db1122b99 100644 --- a/ad_map_access/tests/opendrive/OpenDriveAccessTests.cpp +++ b/ad_map_access/tests/opendrive/OpenDriveAccessTests.cpp @@ -152,12 +152,12 @@ struct OpenDriveAccessTests : ::testing::Test } } EXPECT_NE(expectedLanes.size(), 0u); - for (auto const matchedPosition : mapMatchedPositions0) + for (auto const &matchedPosition : mapMatchedPositions0) { EXPECT_TRUE(lanesTestArea.find(matchedPosition.lanePoint.paraPoint.laneId) != lanesTestArea.end()); expectedLanes.erase(matchedPosition.lanePoint.paraPoint.laneId); } - for (auto const matchedPosition : mapMatchedPositions1) + for (auto const &matchedPosition : mapMatchedPositions1) { EXPECT_TRUE(lanesTestArea.find(matchedPosition.lanePoint.paraPoint.laneId) != lanesTestArea.end()); expectedLanes.erase(matchedPosition.lanePoint.paraPoint.laneId); @@ -492,4 +492,4 @@ TEST_F(OpenDriveAccessTests, read_karlsruhe_map_with_other_proj_string) const auto refPoint = access::getENUReferencePoint(); ASSERT_EQ(refPoint.latitude, ad::map::point::Latitude(49.02067835)); ASSERT_EQ(refPoint.longitude, ad::map::point::Longitude(8.43531364)); -} \ No newline at end of file +} diff --git a/colcon.meta b/colcon.meta index 9fdec77ab..3da6f0c84 100644 --- a/colcon.meta +++ b/colcon.meta @@ -4,7 +4,7 @@ "cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DSPDLOG_BUILD_TESTS=OFF", "-DSPDLOG_BUILD_EXAMPLE=Off"] }, "ad_map_opendrive_reader": { - "dependencies": ["odrSpiral"] + "dependencies": ["odrSpiral", "PROJ4"] } } } diff --git a/colcon_python.meta b/colcon_python.meta index 60db05c0a..c1ccee2e5 100644 --- a/colcon_python.meta +++ b/colcon_python.meta @@ -7,7 +7,7 @@ "cmake-args": ["-DBUILD_PYTHON_BINDING=ON"] }, "ad_map_opendrive_reader": { - "dependencies": ["odrSpiral"] + "dependencies": ["odrSpiral", "PROJ4"] }, "ad_map_access": { "cmake-args": ["-DBUILD_PYTHON_BINDING=ON"] diff --git a/dependencies/PROJ4 b/dependencies/PROJ4 new file mode 160000 index 000000000..da2d678c3 --- /dev/null +++ b/dependencies/PROJ4 @@ -0,0 +1 @@ +Subproject commit da2d678c387ba76704824360dc52771c29d94693 diff --git a/tools/map_maker/CMakeLists.txt b/tools/map_maker/CMakeLists.txt index 9ace6eb01..48adb1e26 100644 --- a/tools/map_maker/CMakeLists.txt +++ b/tools/map_maker/CMakeLists.txt @@ -41,7 +41,7 @@ set(CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 14) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) #todo add -Wshadow -add_compile_options(-Wall -Wextra -Werror -Wconversion -pedantic) +add_compile_options(-Wall -Wextra -Werror -Wconversion -pedantic -Wno-final-dtor-non-final-class) ##################################################################### # Libraries diff --git a/tools/map_maker/geometry/include/ad/map/maker/geometry/Polyline2d.hpp b/tools/map_maker/geometry/include/ad/map/maker/geometry/Polyline2d.hpp index f8b9ebe62..5e0b8aec9 100644 --- a/tools/map_maker/geometry/include/ad/map/maker/geometry/Polyline2d.hpp +++ b/tools/map_maker/geometry/include/ad/map/maker/geometry/Polyline2d.hpp @@ -11,6 +11,7 @@ #pragma once +#include #include #include "ad/map/maker/geometry/Line2d.hpp" #include "ad/map/maker/geometry/Point2d.hpp" diff --git a/tools/map_maker/map_data/include/ad/map/maker/map_data/Intersection.hpp b/tools/map_maker/map_data/include/ad/map/maker/map_data/Intersection.hpp index 63649801d..3df53b86d 100644 --- a/tools/map_maker/map_data/include/ad/map/maker/map_data/Intersection.hpp +++ b/tools/map_maker/map_data/include/ad/map/maker/map_data/Intersection.hpp @@ -99,7 +99,6 @@ struct Intersection : MapDataElement std::vector mRoads; //!< list of internal roads Intersection() = delete; - Intersection &operator=(Intersection const &other) = delete; Intersection(MapDataStore &dataStore, common::LogFactory &logFactory); diff --git a/tools/map_maker/map_data/include/ad/map/maker/map_data/Road.hpp b/tools/map_maker/map_data/include/ad/map/maker/map_data/Road.hpp index 558455e6a..2cc5e570c 100644 --- a/tools/map_maker/map_data/include/ad/map/maker/map_data/Road.hpp +++ b/tools/map_maker/map_data/include/ad/map/maker/map_data/Road.hpp @@ -133,7 +133,6 @@ struct Road : MapDataElement MapDataId mSuccessor{InvalidId}; //! ID of succeeding element (if any), can be another road or an intersection Road() = delete; - Road &operator=(Road const &other) = delete; Road(MapDataStore &dataStore, common::LogChannel &logChannel); diff --git a/tools/map_maker/map_data/src/BigIntersectionGenerator.cpp b/tools/map_maker/map_data/src/BigIntersectionGenerator.cpp index 1f5edf71f..a7ece6b07 100644 --- a/tools/map_maker/map_data/src/BigIntersectionGenerator.cpp +++ b/tools/map_maker/map_data/src/BigIntersectionGenerator.cpp @@ -80,7 +80,7 @@ void BigIntersectionGenerator::generateBigIntersections(double interpolationStep std::unordered_map> bigIntersectionsIdMap; detectBigIntersections(specialIntersectionsSet, bigIntersectionsIdMap); - for (auto const bigIntersectionIds : bigIntersectionsIdMap) + for (auto const &bigIntersectionIds : bigIntersectionsIdMap) { generateBigIntersection(bigIntersectionIds.second, interpolationStepSize, fullInterpolation); }