Skip to content

Commit

Permalink
Fix Ubuntu 20.04 dev build (#361)
Browse files Browse the repository at this point in the history
* Add a new job just to proof the build is now broken

* force 22.04 to make sure it's only a 20.04 problem

* Revert "force 22.04 to make sure it's only a 20.04 problem"

This reverts commit e1b5e02.

* Add cache to ci build

* Attempt to fix build in Ubuntu 20.04

* add this comment just to annoy ourselves
  • Loading branch information
nachovizzo authored Jul 10, 2024
1 parent e19823a commit 8596de8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,32 @@ jobs:
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/cpp/kiss_icp
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

# As the previous job will always install the dependencies from cmake, and this is guaranteed to
# work, we also want to support dev sandboxes where the main dependencies are already
# pre-installed in the system. For now, we only support dev machines under a GNU/Linux
# environmnets. If you are reading this and need the same functionallity in Windows/macOS please
# open a ticket.
cpp_api_dev:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]

steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.apt/cache
key: ${{ runner.os }}-apt-${{ hashFiles('**/ubuntu_dependencies.yml') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake git libeigen3-dev libtbb-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/cpp/kiss_icp
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
1 change: 1 addition & 0 deletions cpp/kiss_icp/core/Deskew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ std::vector<Eigen::Vector3d> DeSkewScan(const std::vector<Eigen::Vector3d> &fram
const Sophus::SE3d &delta) {
const auto delta_pose = delta.log();
std::vector<Eigen::Vector3d> corrected_frame(frame.size());
// TODO(All): This tbb execution is ignoring the max_n_threads config value
tbb::parallel_for(size_t(0), frame.size(), [&](size_t i) {
const auto motion = Sophus::SE3d::exp((timestamps[i] - mid_pose_timestamp) * delta_pose);
corrected_frame[i] = motion * frame[i];
Expand Down
4 changes: 3 additions & 1 deletion cpp/kiss_icp/core/Registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <tbb/global_control.h>
#include <tbb/info.h>
#include <tbb/parallel_reduce.h>
#include <tbb/task_arena.h>

#include <algorithm>
#include <cmath>
Expand Down Expand Up @@ -171,7 +172,8 @@ Registration::Registration(int max_num_iteration, double convergence_criterion,
: max_num_iterations_(max_num_iteration),
convergence_criterion_(convergence_criterion),
// Only manipulate the number of threads if the user specifies something greater than 0
max_num_threads_(max_num_threads > 0 ? max_num_threads : tbb::info::default_concurrency()) {
max_num_threads_(max_num_threads > 0 ? max_num_threads
: tbb::this_task_arena::max_concurrency()) {
// This global variable requires static duration storage to be able to manipulate the max
// concurrency from TBB across the entire class
static const auto tbb_control_settings = tbb::global_control(
Expand Down

0 comments on commit 8596de8

Please sign in to comment.