Skip to content

Support newer colcon and setuptools #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
compiler: clang10
EXTRA_PACKAGES: clang-10
CC: /usr/bin/clang-10
CXX: /usr/bin/clang++-10
PYTHON_BINDING_VERSION: "3.10"
- os: ubuntu-22.04
compiler: gcc11
EXTRA_PACKAGES: ""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
permissions:
contents: write

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
PYTHON_BINDING_VERSION: "3.10"

Expand Down
60 changes: 2 additions & 58 deletions .github/workflows/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,15 @@ if [ "${PYTHON_BINDING_VERSION}" == "3.10" ]; then
IS_PYTHON_3_10=1
fi

IS_UBUNTU_20_04=0
if [ `lsb_release -a | grep Release | grep "20.04" | wc -l` == 1 ]; then
echo "!!!!!!! Ubuntu 20.04: remove python2 !!!!!!!"
sudo apt autoremove python2 python2-dev -y
IS_UBUNTU_20_04=1
if [ "${PYTHON_BINDING_VERSION}" == "" ]; then
echo "!!!!!!! Setting default python version for Ubuntu20.04 !!!!!!!"
IS_PYTHON_3_10=0
PYTHON_BINDING_VERSION="3.8"
fi
elif [ `lsb_release -a | grep Release | grep "22.04" | wc -l` == 1 ]; then
if [ `lsb_release -a | grep Release | grep "22.04" | wc -l` == 1 ]; then
if [ "${PYTHON_BINDING_VERSION}" == "" ]; then
echo "!!!!!!! Setting default python version for Ubuntu22.04 !!!!!!!"
IS_PYTHON_3_10=1
PYTHON_BINDING_VERSION="3.10"
fi
fi

if (( IS_UBUNTU_20_04 && IS_PYTHON_3_10 )); then
echo "!!!!!!! Ubunut 20.04 and python 3.10: install python 3.10 and remove boost !!!!!!!"
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get update
sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}-full
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 10
sudo apt autoremove libboost-all-dev -y
else
echo "!!!!!!! Not Ubuntu 20.04 or not python 3.10: install python${PYTHON_BINDING_VERSION} and boost !!!!!!!"
sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}
sudo apt-get install -y --no-install-recommends libboost-all-dev
fi
sudo apt-get install -y --no-install-recommends libboost-all-dev

sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}-dev libpython${PYTHON_BINDING_VERSION}-dev
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python${PYTHON_BINDING_VERSION}
Expand All @@ -49,40 +28,5 @@ if [[ "${BUILD_DOCU}x" != "x" ]]; then
sudo apt-get install doxygen graphviz lcov
fi

if (( IS_UBUNTU_20_04 && IS_PYTHON_3_10 )); then
echo "!!!!!!! Ubunut 20.04 and python 3.10: compile boost 1.78 !!!!!!!"
pushd dependencies

BOOST_VERSION=1.78.0
BOOST_PACKAGE_BASENAME=boost_${BOOST_VERSION//./_}
wget "https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_PACKAGE_BASENAME}.tar.gz"

tar -xzf ${BOOST_PACKAGE_BASENAME}.tar.gz
pushd ${BOOST_PACKAGE_BASENAME}

py3=`which python3.10`
py3_root=`${py3} -c "import sys; print(sys.prefix)"`
pyv=`$py3 -c "import sys;x='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(x)";`

./bootstrap.sh \
--prefix="/usr" \
--with-libraries=python,filesystem,system,program_options \
--with-python=${py3} --with-python-version=${pyv} --with-python-root=${py3_root}
if (( $? )); then
echo "!!!!!!! boost bootstrap failed !!!!!!!"
cat bootstrap.log
fi

./b2 --prefix="/usr" cxxflags="-fPIC" -j 10 stage release
sudo ./b2 --prefix="/usr" cxxflags="-fPIC" -j 10 install

# ensure our colcon build process ignores boost sources
touch COLCON_IGNORE

popd
popd

fi

sudo apt remove python3-pygments
sudo python${PYTHON_BINDING_VERSION} -m pip install -r .github/workflows/requirements.txt
3 changes: 2 additions & 1 deletion .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ Markdown==3.7
markdown-include==0.8.1
mdx_truly_sane_lists==1.3
mkdocs==1.6.1
packaging==24.1
pygccxml==2.6.1
Pygments==2.19.1
pymdown-extensions==10.14.3
pyplusplus==1.8.7
setuptools==75.8.0
setuptools==80.8.0
six==1.17.0
testresources==2.0.1
unittest-xml-reporting==3.2.0
Expand Down
68 changes: 0 additions & 68 deletions .github/workflows/wheels.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build/
/install/
/log/
/python.venv/
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ 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 20.04 and Ubuntu 22.04. Nevertheless, the library should work in a similar way for any other Linux OS.
To install the basic dependencies for Ubuntu 20.04/22.04 execute the following command:
Currently, the focused operating systems is Ubuntu 22.04. Nevertheless, the library should work in a similar way for any other Linux OS.
To install the basic dependencies for Ubuntu 22.04 execute the following command:
```bash
user$> sudo apt-get install git build-essential cmake libboost-dev libpugixml-dev libgtest-dev libpython-dev libproj-dev
```
Expand All @@ -136,17 +136,16 @@ To download the library, you may run:
```

#### Supported systems <a name="systems"></a>
Development systems are Ubuntu 20.04 and 22.04
Development system is Ubuntu 22.04
Following compiler and Python combinations are [tested continously](https://github.com/intel/ad-rss-lib/blob/main/.github/workflows/build_test.yml):

| | Ubuntu 20.04 | Ubuntu 22.04 |
|:---------------:|:------------:|:------------:|
| Clang 10 | x | |
| GCC 11 | | x |
| Clang 14 | | x |
| Python 3.10 | x | x |
| | Ubuntu 22.04 |
|:---------------:|:------------:|
| GCC 11 | x |
| Clang 14 | x |
| Python 3.10 | x |

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

## Building the library <a name="building"></a>
See the detailed [Build instructions](https://intel.github.io/ad-rss-lib/BUILDING/index.html).
Expand Down
15 changes: 15 additions & 0 deletions ad_rss/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ad_rss</name>
<version>4.5.3</version>
<description>ad_rss</description>
<maintainer email="[email protected]">Intel Corporation</maintainer>
<license>LGPL-2.1-only</license>

<exec_depend>ad_physics</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
6 changes: 6 additions & 0 deletions ad_rss/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ target_link_libraries(${target} PRIVATE
)

configure_file(setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
# fake the ament_cmake_python local_setup.bash file
configure_file(local_setup.bash.in ${CMAKE_CURRENT_BINARY_DIR}/local_setup.bash @ONLY)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/local_setup.bash
DESTINATION
${CMAKE_INSTALL_PREFIX}/share/ad_rss)

install(CODE "\
EXECUTE_PROCESS(\
Expand Down
5 changes: 5 additions & 0 deletions ad_rss/python/local_setup.bash.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

CURRENT_PREFIX=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`/../.." && pwd)

export PYTHONPATH=${PYTHONPATH}:${CURRENT_PREFIX}/local/lib/@PYTHON_BINDING_FOLDER_NAME@/dist-packages
16 changes: 16 additions & 0 deletions ad_rss_map_integration/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ad_rss_map_integration</name>
<version>4.5.3</version>
<description>ad_rss_map_integration</description>
<maintainer email="[email protected]">Intel Corporation</maintainer>
<license>LGPL-2.1-only</license>

<exec_depend>ad_map_access</exec_depend>
<exec_depend>ad_rss</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
8 changes: 7 additions & 1 deletion ad_rss_map_integration/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ target_link_libraries(${target} PRIVATE
)

configure_file(setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py)

# fake the ament_cmake_python local_setup.bash file
configure_file(local_setup.bash.in ${CMAKE_CURRENT_BINARY_DIR}/local_setup.bash @ONLY)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/local_setup.bash
DESTINATION
${CMAKE_INSTALL_PREFIX}/share/ad_rss_map_integration)

install(CODE "\
EXECUTE_PROCESS(\
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/setup.py egg_info --egg-base ${CMAKE_CURRENT_BINARY_DIR} build --build-base ${CMAKE_CURRENT_BINARY_DIR} install --prefix ${CMAKE_INSTALL_PREFIX} --record ${CMAKE_CURRENT_BINARY_DIR}/install.log --single-version-externally-managed bdist_wheel --dist-dir ${CMAKE_INSTALL_PREFIX}/dist ${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_BINDING_NAME}\
Expand Down
5 changes: 5 additions & 0 deletions ad_rss_map_integration/python/local_setup.bash.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

CURRENT_PREFIX=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`/../.." && pwd)

export PYTHONPATH=${PYTHONPATH}:${CURRENT_PREFIX}/local/lib/@PYTHON_BINDING_FOLDER_NAME@/dist-packages
8 changes: 7 additions & 1 deletion colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
},
"ad_map_opendrive_reader": {
"dependencies": ["odrSpiral", "PROJ4"]
}
},
"ad_map_access": {
"dependencies": ["ad_map_opendrive_reader"]
},
"ad_physics": {
"dependencies": ["spdlog"]
},
}
}
6 changes: 4 additions & 2 deletions colcon_python.meta
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DSPDLOG_BUILD_TESTS=OFF", "-DSPDLOG_BUILD_EXAMPLE=Off"]
},
"ad_physics": {
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON"]
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON"],
"dependencies": ["spdlog"]
},
"ad_map_opendrive_reader": {
"dependencies": ["odrSpiral", "PROJ4"]
},
"ad_map_access": {
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON"]
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON"],
"dependencies": ["ad_map_opendrive_reader"]
},
"ad_map_access_qgis": {
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON"],
Expand Down
2 changes: 1 addition & 1 deletion doc/ad_rss/HLD-Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Unit testing achieved code coverage can be retrieved via [github deployment](htt

#### Compiler and compiler security flags

The development platforms are Ubuntu Linux 20.04 Focal Fossa and 22.04 Jammy Jellyfish.
The development platform is Ubuntu Linux 22.04 Jammy Jellyfish.

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

Expand Down
Loading