Skip to content
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

PyBind to bind CarmaClock to Python Module #24

Merged
merged 34 commits into from
May 28, 2024

Conversation

paulbourelly999
Copy link
Contributor

@paulbourelly999 paulbourelly999 commented May 22, 2024

PR Details

Description

This Pull Request adds functionality to create python module bindings for the existing C++ CARMA Time Library. It does this using PyBind11, a light weight, header only library.
Unfortunately do to limitation encounters with downloading and including Python3 for cross-compile targets (armhf, arm32, and arm64) I was only able to get the python module binding to work for native builds (x64). To account for this the, all the python module binding occurs conditionally based on an environment variable BUILD_ARCHICTECTURE set in carma-builds for cross compile targets (https://github.com/usdot-fhwa-stol/carma-builds/blob/a77b21967f06c3a8b66c060f8ed4f1e138b7159f/Dockerfile#L25)

Important

The changes included here will build python module bindings for all native builds and the generated debian package should include the shared library with these bindings. For cross-compile targets, it will simply skip this process and compile just the C++ library since I ran into many issues trying to correctly include dependencies like python3 for cross-compile targets.

Related GitHub Issue

Related Jira Key

TT-69

Motivation and Context

How Has This Been Tested?

test_carma_clock_python_module_binding CMake target

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@paulbourelly999 paulbourelly999 marked this pull request as ready for review May 24, 2024 13:52
carma_clock_py/src/carma_clock_py.cpp Outdated Show resolved Hide resolved
install_dependencies.sh Show resolved Hide resolved
install_dependencies.sh Show resolved Hide resolved
carma_clock_py/python_wrapper_test.py Show resolved Hide resolved
carma_clock_py/python_wrapper_test.py Outdated Show resolved Hide resolved
carma_clock_py/README.md Show resolved Hide resolved
carma_clock_py/cmake/dependencies.cmake Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@paulbourelly999 paulbourelly999 merged commit b584432 into develop May 28, 2024
31 checks passed
@paulbourelly999 paulbourelly999 deleted the tt-69-pybind-python-module branch May 28, 2024 20:45
paulbourelly999 added a commit that referenced this pull request May 28, 2024
@paulbourelly999 paulbourelly999 mentioned this pull request May 28, 2024
9 tasks
paulbourelly999 added a commit that referenced this pull request May 28, 2024
* Update sonar-scanner workflow to target main branch

* Undo #24 unintentional change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants