Skip to content

Commit

Permalink
Fix python binding build and remove Ubuntu 16.04 support (#115)
Browse files Browse the repository at this point in the history
Fixed ad_rss_map_integration python binding build failed in CARLA
environment because of not existing folder being referenced

Remove Ubuntu 16.04 support and use Ubuntu's libproj version
  • Loading branch information
berndgassmann authored Nov 8, 2021
1 parent 2ce3bc8 commit 438ac2b
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 94 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,6 @@ env:
BUILDCMD: "colcon build --event-handlers console_direct+ --executor sequential --packages-up-to ad_rss ad_rss_map_integration --cmake-args -DBUILD_HARDENING=ON -DBUILD_TESTING=ON -DBUILD_PYTHON_BINDING=ON -DPYTHON_BINDING_VERSION=${PYTHON_BINDING_VERSION} && colcon test --event-handlers console_direct+ --packages-select ad_rss ad_rss_map_integration && colcon test-result"

jobs:
ubuntu16job:
name: Ubuntu 16.04
runs-on: ubuntu-16.04

strategy:
matrix:
include:
- compiler: gcc5
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "2.7"
- compiler: gcc6
EXTRA_PACKAGES: g++-6
CC: /usr/bin/gcc-6
CXX: /usr/bin/g++-6
PYTHON_BINDING_VERSION: "2.7"
- compiler: clang5
EXTRA_PACKAGES: clang-5.0
CC: /usr/bin/clang-5.0
CXX: /usr/bin/clang++-5.0
PYTHON_BINDING_VERSION: "2.7"
- compiler: clang6
EXTRA_PACKAGES: clang-6.0
CC: /usr/bin/clang-6.0
CXX: /usr/bin/clang++-6.0
PYTHON_BINDING_VERSION: "2.7"

steps:
- uses: actions/checkout@v2
with:
submodules: true

- 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}
ubuntu18job:
name: Ubuntu 18.04
runs-on: ubuntu-18.04
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ 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: |
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_rss_map_integration --meta colcon_python.meta --event-handlers console_direct+ --cmake-args -DPYTHON_BINDING_VERSION=${PYTHON_BINDING_VERSION}
- name: Repair wheels
shell: bash
Expand All @@ -38,10 +44,10 @@ jobs:
for whl in install/ad_rss_map_integration/dist/*.whl; do
auditwheel repair $whl --plat ${WHEEL_PLATFORM} --wheel-dir wheelhouse
done
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event_name == 'release'}}
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: wheelhouse/
# - name: Publish wheels to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# if: ${{ github.event_name == 'release'}}
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages_dir: wheelhouse/
36 changes: 16 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ Note: The RSS module in this library does not initiate evasive manuevers. At the
## Getting started <a name="started"></a>

#### Installation of dependencies
Currently, the focused operating systems are Ubuntu 16.04 and Ubuntu 18.04. Nevertheless, the library should work in a similar way for any other Linux OS.
To install the basic dependencies for Ubuntu 16.04/18.04 execute the following command:
Currently, the focused operating systems are Ubuntu 18.04 and Ubuntu 20.04. Nevertheless, the library should work in a similar way for any other Linux OS.
To install the basic dependencies for Ubuntu 18.04/20.04 execute the following command:
```bash
user$> sudo apt-get install git build-essential cmake libboost-dev
user$> sudo apt-get install git build-essential cmake libboost-dev libpugixml-dev libgtest-dev libpython-dev libproj-dev
```

If you want to use doxygen for API documentation, please also install:
Expand All @@ -135,20 +135,16 @@ To download the library, you may run:
```

#### Supported systems <a name="systems"></a>
Development systems are Ubuntu 16.04 and Ubuntu 18.04.
Development systems are Ubuntu 18.04 and Ubuntu 20.04.
Following compiler combinations are [tested continously](https://github.com/intel/ad-rss-lib/blob/master/.travis.yml):

| | Ubuntu 16.04 | Ubuntu 18.04 | Ubuntu 20.04 |
|:---------------:|:------------:|:------------:|:------------:|
| Clang 5.0 | x | | |
| Clang 6.0 | x | | |
| Clang 7 | | x | |
| Clang 8 | | x | |
| GCC 5 | x | | |
| GCC 6 | x | | |
| GCC 7 | | x | |
| GCC 8 | | x | |
| GCC 9 | | x | x |
| | Ubuntu 18.04 | Ubuntu 20.04 |
|:---------------:|:------------:|:------------:|
| Clang 7 | x | |
| Clang 8 | x | |
| GCC 7 | x | |
| GCC 8 | x | |
| GCC 9 | x | x |

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

Expand All @@ -161,15 +157,15 @@ Contibutions are very welcome!
Before submitting a pull request, please ensure that your code compiles successfully and that the tests run successfully.
Please also check that your code formatting complies to the provided clang style. To do so, you can run:
```bash
ad_rss$> sudo apt-get install clang-format-3.9
ad_rss$> find -iname *.cpp -o -iname *.hpp | xargs clang-format-3.9 -style=file -i
ad-rss-lib$> sudo apt-get install clang-format-10
ad-rss-lib$> find -iname *.cpp -o -iname *.hpp | xargs clang-format-10 -style=file -i
```
This command will automatically update the code formatting to be compliant with our style.

In addition, please perform a static code analysis, if possible.
```bash
ad_rss$> sudo apt-get install clang-tidy
ad_rss$> cmake -DBUILD_STATIC_ANALYSIS=ON
ad_rss$> make clang-tidy
ad-rss-lib$> sudo apt-get install clang-tidy
ad-rss-lib$> cmake -DBUILD_STATIC_ANALYSIS=ON
ad-rss-lib$> make clang-tidy
```
This may provide a list of possible improvements that you would like to consider in your pull request.
2 changes: 1 addition & 1 deletion ad_rss_map_integration/python/generate_python_lib.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def main():
"""
include_dirs = {
"@GENPY_INCLUDE_DIRS@",
"@CMAKE_CURRENT_LIST_DIR@/../generated/include/",
#"@CMAKE_CURRENT_LIST_DIR@/../generated/include/",
"@CMAKE_CURRENT_LIST_DIR@/../include/"
}

Expand Down
6 changes: 0 additions & 6 deletions colcon.meta
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"names": {
"PROJ4": {
"cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON"]
},
"spdlog": {
"cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DSPDLOG_BUILD_TESTS=OFF", "-DSPDLOG_BUILD_EXAMPLE=Off"]
},
"ad_map_opendrive_reader": {
"dependencies": ["PROJ4"]
}
}
}
6 changes: 0 additions & 6 deletions colcon_python.meta
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
{
"names": {
"PROJ4": {
"cmake-args": ["-DBUILD_SHARED_LIBS=OFF", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"]
},
"spdlog": {
"cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DSPDLOG_BUILD_TESTS=OFF", "-DSPDLOG_BUILD_EXAMPLE=Off"]
},
"ad_physics": {
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON"]
},
"ad_map_opendrive_reader": {
"dependencies": ["PROJ4"]
},
"ad_map_access": {
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON"]
},
Expand Down
1 change: 0 additions & 1 deletion dependencies/PROJ
Submodule PROJ deleted from da2d67
11 changes: 7 additions & 4 deletions doc/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ The components within this repository have some dependencies:
- **ad_rss_map_integration**:
- *ad_rss*
- ad_map_access: <https://github.com/carla-simulator/map.git>
- proj: <https://www.osgeo.org/projects/proj/>
- Boost (including components filesystem and program_options)
- ad_map_opendrive_reader: <https://github.com/carla-simulator/map.git>
- pugixml
- proj: <https://www.osgeo.org/projects/proj/>
- spdlog: <https://github.com/gabime/spdlog.git>
- **ad_rss_map_integration_python** (if Python binding build enabled):
- ad_map_access_python: <https://github.com/carla-simulator/map.git>
Expand All @@ -25,16 +28,17 @@ The components within this repository have some dependencies:
- gtest aka. googletests < 1.10 : <https://github.com/google/googletest>
- xmlrunner

Dependencies provided by Ubunutu (>= 16.04):
Dependencies provided by Ubunutu (>= 18.04):

- Boost
- pugixml
- libproj-dev
- gtest
- libpython-dev

Those can be installed by calling:
```bash
$> sudo apt-get install libboost-all-dev libpugixml-dev libgtest-dev libpython-dev
$> sudo apt-get install libboost-all-dev libpugixml-dev libgtest-dev libpython-dev libproj-dev
```

Additional dependencies for the python bindings:
Expand All @@ -49,7 +53,6 @@ Remaining dependencies are present as GIT submodules; also to fix the version of
- ad_map_opendrive_reader
- ad_physics
- spdlog
- proj

## Building
For compiling all libraries and the dependencies, colcon is used [colcon](https://colcon.readthedocs.io/).
Expand Down
6 changes: 6 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
## Release 4.5.0

#### :rocket: New Features
* Remove Ubuntu 16.04 support
* Add creation of python wheels
* Update map to v2.5.0

## Release 4.4.3

#### :ghost: Maintenance
* Fix: ad_rss_map_integration python binding build

## Release 4.4.2

#### :ghost: Maintenance
Expand Down
4 changes: 2 additions & 2 deletions doc/ad_rss/HLD-Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ Unit testing achieved code coverage can be retrieved via [github deployment](htt

#### Compiler and compiler security flags

The development platforms are Ubuntu Linux 16.04 Xenial and Ubuntu Linux 18.04 Bionic.
The development platforms are Ubuntu Linux 18.04 Bionic and 20.04 Focal Fossa.

A standard cmake toolchain has been used to compile the library. Other supported compilers are listed at the [main page](../../#systems)

The following, strict, [compilation flags](https://github.com/intel/ad-rss-lib/blob/master/cmake/warnings.cmake) are used:
C++11, -Werror, -Wall, -Wextra, -pedantic, -Wconversion, -Wsign-conversion, -Wfloat-equal -Wshadow -Wswitch-default -Wenum-compare -Wformat -Wformat-security.
C++14, -Werror, -Wall, -Wextra, -pedantic, -Wconversion, -Wsign-conversion, -Wfloat-equal -Wshadow -Wswitch-default -Wenum-compare -Wformat -Wformat-security.

* -Werror turns all warnings into errors
* -Wall enables many warnings about code constructs that are questionable
Expand Down

0 comments on commit 438ac2b

Please sign in to comment.