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

restore compatibility with gcc 6.3.0, libprotobuf 3.0.0, boost v1.62.0 #2953

Merged
merged 5 commits into from
Mar 20, 2021

Conversation

nilsnolde
Copy link
Member

I wanted to build python packages on debian 9 (for compatibility with PEP600), which has a bunch of fairly old versions.. Note, the build was with -DENABLE_SERVICES=OFF -DENABLE_TESTS=OFF -DENABLE_BENCHMARKS=OFF..

I would've built at least with SERVICES=ON, but I couldn't get prime_server to be discovered by CMake (v3.18.3), which could be an issue with pkg-config which is on v0.29 on debian 9..

-- Checking for module 'libprime_server>=0.6.3'
--   Requested 'libprime_server >= 0.6.3' but version of libprime_server is
CMake Error at /usr/local/share/cmake-3.18/Modules/FindPkgConfig.cmake:545 (message):
  A required package was not found

Comment on lines -41 to -42
// corrects geometry and handedness as expected by bg for rings
bg::correct(new_ring);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct() is not supporting geographic CS at lower versions it seems. but actually, let me look at this again in bit more detail.. it corrects a bunch of things, but the handedness check is probably most useful. we register a valhalla type as ring via a macro, where I guess the expected handedness is clockwise (the default for builtin ring type) and all tests are on clockwise rings as well. I'm not sure what'll happen if I add a counterclockwise test, so I'll do that real quick

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, seems to be fine.. I altered the avoids test to also test a counterclockwise ring and still passes

@@ -424,7 +424,8 @@ void thor_worker_t::path_arrive_by(Api& api, const std::string& costing) {

auto route_two_locations = [&, this](auto& origin, auto& destination) -> bool {
// Get the algorithm type for this location pair
thor::PathAlgorithm* path_algorithm = get_path_algorithm(costing, *origin, *destination, options);
thor::PathAlgorithm* path_algorithm =
this->get_path_algorithm(costing, *origin, *destination, options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you share the compiler messages that are making you use this syntax, is it something about being ambiguous? we dont use this to access members anywhere else in the code base that im aware of so itd be sad to start doing that stylistically if we can instead just rename some other methods that the compiler is complaining about?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was smth along the lines of Missing object on those lines where this-> was missing. It's not a general access member thing, rather smth to do with capturing this inside the lambda. I can reproduce tmrw and paste the trace if you want.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here it is:

/valhalla/src/thor/route_action.cc: In instantiation of ‘valhalla::thor::thor_worker_t::path_arrive_by(valhalla::Api&, const string&)::<lambda(auto:2&, auto:3&)> [with auto:2 = std::reverse_iterator<google::protobuf::internal::RepeatedPtrIterator<valhalla::Location> >; auto:3 = std::reverse_iterator<google::protobuf::internal::RepeatedPtrIterator<valhalla::Location> >]’:
/valhalla/src/thor/route_action.cc:518:49:   required from here
/valhalla/src/thor/route_action.cc:441:87: error: cannot call member function ‘std::vector<std::vector<valhalla::thor::PathInfo> > valhalla::thor::thor_worker_t::get_path(valhalla::thor::PathAlgorithm*, valhalla::Location&, valhalla::Location&, const string&, const valhalla::Options&)’ without object
     auto temp_paths = get_path(path_algorithm, *origin, *destination, costing, options);
                                                                                       ^
/valhalla/src/thor/route_action.cc:445:5: error: unable to deduce ‘auto&&’ from ‘temp_paths’
     for (auto& temp_path : temp_paths) {
     ^~~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a quick search I couldn't find any other similar error report, so I'd blame the old GCC?! In any case, it seems capturing [&, this] is redundant and could be simply [&], which compiles both without the above fix on a recent GCC (v10.2) and with the above fix on v6.3.0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah man that does suck, very unfortunate old compiler bug

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jeez, you're up early on a sat ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah DST hit in..

@@ -1582,7 +1582,7 @@ summarize_route_legs(const google::protobuf::RepeatedPtrField<DirectionsRoute>&
// unique the same leg (leg_idx) between all routes.
for (size_t route_i = 0; route_i < routes.size(); route_i++) {

size_t num_legs_i = routes[route_i].legs_size();
size_t num_legs_i = routes.Get(route_i).legs_size();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

classic old protobuf 😄

std::vector<ring_bg_t> rings;
rings.push_back({{node_a.lng() + 0.1 * dx, node_a.lat() - 0.01 * dy},
{node_a.lng() + 0.1 * dx, node_a.lat() - 0.1 * dy},
{node_a.lng() - 0.1 * dx, node_a.lat() - 0.1 * dy},
{node_a.lng() - 0.1 * dx, node_a.lat() - 0.01 * dy},
{node_a.lng() + 0.1 * dx, node_a.lat() - 0.01 * dy}});

// one counterclockwise ring
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@kevinkreiser kevinkreiser merged commit 0bc7224 into master Mar 20, 2021
@kevinkreiser
Copy link
Member

no need to merge master and wait for another round of CI changes are localized

abhi2039 pushed a commit to abhi2039/valhalla that referenced this pull request Mar 30, 2021
…halla into pedestrian_crossing

* 'pedestrian_crossing' of https://github.com/abhi2039/valhalla:
  build: Bail with error if non-existant build-type specified (valhalla#2965)
  nit: Enables compiler warnings in part of mjolnir module (valhalla#2922)
  fix missing comma scripts/valhalla_build_config (valhalla#2963)
  Remove duplicate names being used across different gurka tests (valhalla#2962)
  Dont abort bidirectional a* search if only one direction is exhausted (valhalla#2936)
  penalize uturns at pencil points and short internal edges (valhalla#2944)
  Remove unused IsNextEdgeInternal function (valhalla#2958)
  restore compatibility with gcc 6.3.0, libprotobuf 3.0.0, boost v1.62.0 (valhalla#2953)
  Add ability to build Valhalla modules as STATIC libraries (valhalla#2957)
  Allow disabling Werror (valhalla#2937)
  Enhanced logic for IsTurnChannelManeuverCombinable (valhalla#2952)
  Allow config object to be passed-in to path algorithms (valhalla#2949)
  Floating-point precision fix in meili::Project() fixes map-match issue (valhalla#2946)
  Use kServiceRoad edges while reclassifying ferry connections (valhalla#2933)
  ci: Update cache key to trigger clearing it (valhalla#2947)
@nilsnolde nilsnolde deleted the nn_older_versions_support branch February 24, 2024 14:55
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.

None yet

2 participants