Skip to content

Commit

Permalink
Enable Ubuntu 22.04 builds
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fabianoboril committed Nov 12, 2023
1 parent cc9618f commit c6f011b
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 39 deletions.
63 changes: 55 additions & 8 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
ubuntu18job:
name: Ubuntu 18.04
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

strategy:
matrix:
Expand All @@ -28,11 +28,6 @@ jobs:
CC: /usr/bin/gcc-8
CXX: /usr/bin/g++-8
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
- compiler: gcc9
EXTRA_PACKAGES: g++-9
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
- compiler: clang7
EXTRA_PACKAGES: clang-7
CC: /usr/bin/clang-7
Expand All @@ -44,9 +39,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
Expand All @@ -59,10 +61,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
Expand All @@ -75,6 +78,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
Expand All @@ -94,3 +102,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}
24 changes: 16 additions & 8 deletions .github/workflows/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
#!/bin/bash

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
python3_pkgs="libpython3-dev python3 python3-pip python3-setuptools python3-wheel"
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==2.2.1 pyplusplus==1.8.4 xmlrunner
else
sudo apt-get install -y --no-install-recommends "python-is-python3"
fi
6 changes: 2 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheels/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,19 @@ To download the library, you may run:
```

#### Supported systems <a name="systems"></a>
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 | |
| Clang 10 | | x | |
| GCC 11 | | | x |
| Clang 14 | | | x |

Important: cmake is required to be at least version 3.5!

Expand Down
6 changes: 3 additions & 3 deletions ad_map_access/tests/opendrive/OpenDriveAccessTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
}
}
2 changes: 1 addition & 1 deletion colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
}
2 changes: 1 addition & 1 deletion colcon_python.meta
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
1 change: 1 addition & 0 deletions dependencies/PROJ4
Submodule PROJ4 added at da2d67
7 changes: 6 additions & 1 deletion tools/map_maker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ 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)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0.0)
add_compile_options(-Wall -Wextra -Werror -Wconversion -pedantic -Wno-final-dtor-non-final-class)
else()
add_compile_options(-Wall -Wextra -Werror -Wconversion -pedantic)
endif()

#####################################################################
# Libraries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#pragma once

#include <cstdint>
#include <vector>
#include "ad/map/maker/geometry/Line2d.hpp"
#include "ad/map/maker/geometry/Point2d.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ struct Intersection : MapDataElement
std::vector<MapDataId> mRoads; //!< list of internal roads

Intersection() = delete;
Intersection &operator=(Intersection const &other) = delete;

Intersection(MapDataStore &dataStore, common::LogFactory &logFactory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tools/map_maker/map_data/src/BigIntersectionGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void BigIntersectionGenerator::generateBigIntersections(double interpolationStep
std::unordered_map<uint32_t, std::vector<MapDataId>> bigIntersectionsIdMap;
detectBigIntersections(specialIntersectionsSet, bigIntersectionsIdMap);

for (auto const bigIntersectionIds : bigIntersectionsIdMap)
for (auto const &bigIntersectionIds : bigIntersectionsIdMap)
{
generateBigIntersection(bigIntersectionIds.second, interpolationStepSize, fullInterpolation);
}
Expand Down

0 comments on commit c6f011b

Please sign in to comment.