Skip to content

Commit

Permalink
geo/osrm-backend: update to a newer commit to unbreak with boost 1.87.
Browse files Browse the repository at this point in the history
it still builds against the in-tree boost 1.84.
cf Project-OSRM/osrm-backend#6432
and Project-OSRM/osrm-backend#7073
and Project-OSRM/osrm-backend#6903 (mapbox
variant removal)
  • Loading branch information
landryb committed Nov 20, 2024
1 parent 9879b3b commit eca3fb7
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 72 deletions.
10 changes: 4 additions & 6 deletions geo/osrm-backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ COMMENT = high-performance road network routing engine

GH_ACCOUNT = Project-OSRM
GH_PROJECT = osrm-backend
GH_COMMIT = 31e31a63d062fb804f5f4695ed3036ca7a269ead
REVISION = 2
DISTNAME = osrm-backend-5.27.1pl0
GH_COMMIT = d9ce9cf780777c96d74e0430b7c6f1dee6930f9a
DISTNAME = osrm-backend-5.27.1pl1

CATEGORIES = geo

Expand All @@ -18,9 +17,8 @@ HOMEPAGE = https://project-osrm.org/
PERMIT_PACKAGE = Yes

WANTLIB += ${COMPILER_LIBCXX} ${MODLUA_WANTLIB}
WANTLIB += boost_chrono-mt boost_date_time-mt boost_filesystem-mt
WANTLIB += boost_iostreams-mt boost_program_options-mt boost_regex-mt
WANTLIB += boost_system-mt boost_thread-mt bz2 c expat m tbb z
WANTLIB += boost_date_time-mt boost_iostreams-mt boost_program_options-mt
WANTLIB += boost_regex-mt boost_thread-mt bz2 c expat m tbb z

COMPILER = base-clang ports-gcc

Expand Down
4 changes: 2 additions & 2 deletions geo/osrm-backend/distinfo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SHA256 (osrm-backend-5.27.1pl0-31e31a63.tar.gz) = 1BCHnp2wPyF7Eiz9AZvfVrOBCsyGortUCnyilOqK7ns=
SIZE (osrm-backend-5.27.1pl0-31e31a63.tar.gz) = 11087133
SHA256 (osrm-backend-5.27.1pl1-d9ce9cf7.tar.gz) = 0vrwee0MEK1JrC2Nx6S7set+j1KScVpFN/5GGNfoj2w=
SIZE (osrm-backend-5.27.1pl1-d9ce9cf7.tar.gz) = 11546328
17 changes: 17 additions & 0 deletions geo/osrm-backend/patches/patch-include_server_server_hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
https://github.com/Project-OSRM/osrm-backend/pull/7073

fix build with boost 1.87.0

Index: include/server/server.hpp
--- include/server/server.hpp.orig
+++ include/server/server.hpp
@@ -53,8 +53,7 @@ class Server
const auto port_string = std::to_string(port);

boost::asio::ip::tcp::resolver resolver(io_context);
- boost::asio::ip::tcp::resolver::query query(address, port_string);
- boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
+ boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(address, port_string).begin();

acceptor.open(endpoint.protocol());
#ifdef SO_REUSEPORT
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ https://github.com/Project-OSRM/osrm-backend/pull/6493
Index: src/extractor/edge_based_graph_factory.cpp
--- src/extractor/edge_based_graph_factory.cpp.orig
+++ src/extractor/edge_based_graph_factory.cpp
@@ -32,7 +32,11 @@
@@ -31,7 +31,11 @@

#include <tbb/blocked_range.h>
#include <tbb/parallel_for.h>
Expand All @@ -14,23 +14,21 @@ Index: src/extractor/edge_based_graph_factory.cpp
#include <tbb/parallel_pipeline.h>
+#endif

namespace std
namespace osrm::extractor
{
@@ -582,8 +586,13 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
@@ -569,7 +573,11 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
const constexpr unsigned GRAINSIZE = 100;

// First part of the pipeline generates iterator ranges of IDs in sets of GRAINSIZE
+#if TBB_VERSION_MAJOR == 2020
+ tbb::filter_t<void, tbb::blocked_range<NodeID>> generator_stage(
+ tbb::filter::serial_in_order, [&](tbb::flow_control &fc) {
+#else
tbb::filter<void, tbb::blocked_range<NodeID>> generator_stage(
tbb::filter_mode::serial_in_order, [&](tbb::flow_control &fc) {
+#endif
if (current_node < node_count)
{
auto next_node = std::min(current_node + GRAINSIZE, node_count);
@@ -721,8 +730,13 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
tbb::filter_mode::serial_in_order,
[&](tbb::flow_control &fc)
{
@@ -713,8 +721,13 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
//
// Edge-based-graph stage
//
Expand All @@ -41,10 +39,10 @@ Index: src/extractor/edge_based_graph_factory.cpp
tbb::filter<tbb::blocked_range<NodeID>, EdgesPipelineBufferPtr> processor_stage(
tbb::filter_mode::parallel,
+#endif
[&](const tbb::blocked_range<NodeID> &intersection_node_range) {
[&](const tbb::blocked_range<NodeID> &intersection_node_range)
{
auto buffer = std::make_shared<EdgesPipelineBuffer>();
buffer->nodes_processed = intersection_node_range.size();
@@ -1132,8 +1146,13 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
@@ -1124,9 +1137,14 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
util::UnbufferedLog log;
util::Percent routing_progress(log, node_count);
std::vector<EdgeWithData> delayed_data;
Expand All @@ -53,8 +51,9 @@ Index: src/extractor/edge_based_graph_factory.cpp
+ tbb::filter::serial_in_order, [&](auto buffer) {
+#else
tbb::filter<EdgesPipelineBufferPtr, void> output_stage(
tbb::filter_mode::serial_in_order, [&](auto buffer) {
tbb::filter_mode::serial_in_order,
[&](auto buffer)
+#endif
{
routing_progress.PrintAddition(buffer->nodes_processed);

m_connectivity_checksum = buffer->checksum.update_checksum(m_connectivity_checksum);
50 changes: 26 additions & 24 deletions geo/osrm-backend/patches/patch-src_extractor_extractor_cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,35 @@ Index: src/extractor/extractor.cpp

#include <algorithm>
#include <atomic>
@@ -445,8 +449,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
ExtractionRelationContainer relations;
@@ -443,8 +447,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip

const auto buffer_reader = [](osmium::io::Reader &reader) {
const auto buffer_reader = [](osmium::io::Reader &reader)
{
+#if TBB_VERSION_MAJOR == 2020
+ return tbb::filter_t<void, SharedBuffer>(
+ tbb::filter::serial_in_order, [&reader](tbb::flow_control &fc) {
+ tbb::filter::serial_in_order,
+#else
return tbb::filter<void, SharedBuffer>(
tbb::filter_mode::serial_in_order, [&reader](tbb::flow_control &fc) {
tbb::filter_mode::serial_in_order,
+#endif
[&reader](tbb::flow_control &fc)
{
if (auto buffer = reader.read())
{
return std::make_shared<osmium::memory::Buffer>(std::move(buffer));
@@ -467,15 +476,25 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
@@ -467,8 +476,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
osmium_index_type location_cache;
osmium_location_handler_type location_handler(location_cache);

+#if TBB_VERSION_MAJOR == 2020
+ tbb::filter_t<SharedBuffer, SharedBuffer> location_cacher(
+ tbb::filter::serial_in_order, [&location_handler](SharedBuffer buffer) {
+ tbb::filter::serial_in_order,
+#else
tbb::filter<SharedBuffer, SharedBuffer> location_cacher(
tbb::filter_mode::serial_in_order, [&location_handler](SharedBuffer buffer) {
tbb::filter_mode::serial_in_order,
+#endif
[&location_handler](SharedBuffer buffer)
{
osmium::apply(buffer->begin(), buffer->end(), location_handler);
return buffer;
@@ -476,8 +490,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
});

// OSM elements Lua parser
Expand All @@ -54,23 +56,23 @@ Index: src/extractor/extractor.cpp
tbb::filter_mode::parallel,
+#endif
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[&](const SharedBuffer buffer) {
ParsedBuffer parsed_buffer;
@@ -496,8 +515,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
[&](const SharedBuffer buffer)
{
@@ -499,8 +518,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
unsigned number_of_ways = 0;
unsigned number_of_restrictions = 0;
unsigned number_of_maneuver_overrides = 0;
+#if TBB_VERSION_MAJOR == 2020
+ tbb::filter_t<ParsedBuffer, void> buffer_storage(
+ tbb::filter::serial_in_order, [&](const ParsedBuffer &parsed_buffer) {
+ tbb::filter::serial_in_order,
+#else
tbb::filter<ParsedBuffer, void> buffer_storage(
tbb::filter_mode::serial_in_order, [&](const ParsedBuffer &parsed_buffer) {
tbb::filter_mode::serial_in_order,
+#endif
[&](const ParsedBuffer &parsed_buffer)
{
number_of_nodes += parsed_buffer.resulting_nodes.size();
// put parsed objects thru extractor callbacks
for (const auto &result : parsed_buffer.resulting_nodes)
@@ -523,8 +547,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
@@ -528,8 +552,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
}
});

Expand All @@ -82,9 +84,9 @@ Index: src/extractor/extractor.cpp
tbb::filter_mode::parallel,
+#endif
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[&](const SharedBuffer buffer) {
if (!buffer)
@@ -561,8 +590,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
[&](const SharedBuffer buffer)
{
@@ -567,8 +596,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip
});

unsigned number_of_relations = 0;
Expand All @@ -96,5 +98,5 @@ Index: src/extractor/extractor.cpp
tbb::filter_mode::serial_in_order,
+#endif
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[&](const std::shared_ptr<ExtractionRelationContainer> parsed_relations) {
number_of_relations += parsed_relations->GetRelationsNum();
[&](const std::shared_ptr<ExtractionRelationContainer> parsed_relations)
{
24 changes: 12 additions & 12 deletions geo/osrm-backend/patches/patch-src_guidance_guidance_processing_cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ Index: src/guidance/guidance_processing.cpp

#include <thread>

@@ -97,8 +101,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph &
@@ -95,8 +99,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph &
const constexpr unsigned GRAINSIZE = 100;

// First part of the pipeline generates iterator ranges of IDs in sets of GRAINSIZE
+#if TBB_VERSION_MAJOR == 2020
+ tbb::filter_t<void, tbb::blocked_range<NodeID>> generator_stage(
+ tbb::filter::serial_in_order, [&](tbb::flow_control &fc) {
+ tbb::filter::serial_in_order,
+#else
tbb::filter<void, tbb::blocked_range<NodeID>> generator_stage(
tbb::filter_mode::serial_in_order, [&](tbb::flow_control &fc) {
tbb::filter_mode::serial_in_order,
+#endif
[&](tbb::flow_control &fc)
{
if (current_node < node_count)
{
auto next_node = std::min(current_node + GRAINSIZE, node_count);
@@ -116,8 +125,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph &
//
// Guidance stage
Expand All @@ -41,20 +41,20 @@ Index: src/guidance/guidance_processing.cpp
tbb::filter<tbb::blocked_range<NodeID>, TurnsPipelineBufferPtr> guidance_stage(
tbb::filter_mode::parallel,
+#endif
[&](const tbb::blocked_range<NodeID> &intersection_node_range) {
[&](const tbb::blocked_range<NodeID> &intersection_node_range)
{
auto buffer = std::make_shared<TurnsPipelineBuffer>();
buffer->nodes_processed = intersection_node_range.size();
@@ -308,8 +322,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph &
@@ -307,8 +321,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph &
util::Percent guidance_progress(log, node_count);
std::vector<guidance::TurnData> delayed_turn_data;

+#if TBB_VERSION_MAJOR == 2020
+ tbb::filter_t<TurnsPipelineBufferPtr, void> guidance_output_stage(
+ tbb::filter::serial_in_order, [&](auto buffer) {
+ tbb::filter::serial_in_order,
+#else
tbb::filter<TurnsPipelineBufferPtr, void> guidance_output_stage(
tbb::filter_mode::serial_in_order, [&](auto buffer) {
tbb::filter_mode::serial_in_order,
+#endif
[&](auto buffer)
{
guidance_progress.PrintAddition(buffer->nodes_processed);

connectivity_checksum = buffer->checksum.update_checksum(connectivity_checksum);
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ https://github.com/Project-OSRM/osrm-backend/pull/6493
Index: src/partitioner/recursive_bisection.cpp
--- src/partitioner/recursive_bisection.cpp.orig
+++ src/partitioner/recursive_bisection.cpp
@@ -64,12 +64,20 @@ RecursiveBisection::RecursiveBisection(BisectionGraph
return TreeNode{std::move(graph), internal_state.SCCDepth()};
});
@@ -65,12 +65,20 @@ RecursiveBisection::RecursiveBisection(BisectionGraph
return TreeNode{std::move(graph), internal_state.SCCDepth()};
});

+#if TBB_VERSION_MAJOR == 2020
+ using Feeder = tbb::parallel_do_feeder<TreeNode>;
Expand All @@ -18,10 +18,10 @@ Index: src/partitioner/recursive_bisection.cpp

// Bisect graph into two parts. Get partition point and recurse left and right in parallel.
+#if TBB_VERSION_MAJOR == 2020
+ tbb::parallel_do(begin(forest), end(forest), [&](const TreeNode &node, Feeder &feeder) {
+ tbb::parallel_do(
+#else
tbb::parallel_for_each(begin(forest), end(forest), [&](const TreeNode &node, Feeder &feeder) {
tbb::parallel_for_each(
+#endif
const auto cut =
computeInertialFlowCut(node.graph, num_optimizing_cuts, balance, boundary_factor);
const auto center = internal_state.ApplyBisection(
begin(forest),
end(forest),
[&](const TreeNode &node, Feeder &feeder)
6 changes: 0 additions & 6 deletions geo/osrm-backend/pkg/PLIST
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
@bin bin/osrm-extract
@bin bin/osrm-partition
@bin bin/osrm-routed
include/mapbox/
include/mapbox/optional.hpp
include/mapbox/recursive_wrapper.hpp
include/mapbox/variant.hpp
include/mapbox/variant_io.hpp
include/mapbox/variant_visitor.hpp
include/osrm/
include/osrm/approach.hpp
include/osrm/bearing.hpp
Expand Down

0 comments on commit eca3fb7

Please sign in to comment.