Skip to content

Commit

Permalink
fix: Boost warnings due to deprecations (#880)
Browse files Browse the repository at this point in the history
This fixes some changed / moved / deprecated boost
headers. Functionality stays the same

* add a workaround for boost 1.71.0 which we have on ubuntu 20.04
* add type def
  • Loading branch information
paulgessinger committed Jul 21, 2021
1 parent 9109be1 commit 4340ad2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions Examples/Run/MagneticField/BFieldAccessExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@
#include <string>

#include <boost/program_options.hpp>

#if ((BOOST_VERSION / 100) % 1000) <= 71
// Boost <=1.71 and lower do not have progress_display.hpp as a replacement yet
#include <boost/progress.hpp>
using progress_display = boost::progress_display;
#else
// Boost >=1.72 can use this as a replacement
#include <boost/timer/progress_display.hpp>
using progress_display = boost::timer::progress_display;
#endif

/// The main executable
///
Expand All @@ -42,7 +51,7 @@ void accessStepWise(const Acts::MagneticFieldProvider& bField,
auto bCache = bField.makeCache(bFieldContext);
// boost display
size_t totalSteps = events * theta_steps * phi_steps * access_steps;
boost::progress_display show_progress(totalSteps);
progress_display show_progress(totalSteps);
// the event loop
// loop over the events - @todo move to parallel for
for (size_t ievt = 0; ievt < events; ++ievt) {
Expand Down Expand Up @@ -83,7 +92,7 @@ void accessRandom(const Acts::MagneticFieldProvider& bField,

// initialize the field cache
auto bCache = bField.makeCache(bFieldContext);
boost::progress_display show_progress(totalSteps);
progress_display show_progress(totalSteps);

// the event loop
// loop over the events - @todo move to parallel for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/// @file MagneticFieldInterfaceConsistencyTests.cpp

#include <boost/test/data/test_case.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>
#include <boost/test/unit_test.hpp>

#include "Acts/Definitions/Algebra.hpp"
Expand Down

0 comments on commit 4340ad2

Please sign in to comment.