ad-freiburg / pfaedle

Precise map-matching for public transit feeds. Generates high-quality GTFS shapes from OSM data.
GNU General Public License v3.0
208 stars 29 forks source link

Enable compiling on macOS #35

Closed stupidpupil closed 2 years ago

stupidpupil commented 2 years ago

Couple of small changes to get it to compile on GitHub Action macOS runners.

(I'm not 100% confident that the uint-to-int thing is right.)

patrickbr commented 2 years ago

Regarding the uint thing - could you post the error message of the original code on macOS?

stupidpupil commented 2 years ago

"error: call to member function 'val' is ambiguous" I think. Will try to double-check.

stupidpupil commented 2 years ago
/Users/runner/work/wales_ish_otp_graph/wales_ish_otp_graph/pfaedle/src/util/json/Writer.cpp:114:7: error: call to member function 'val' is ambiguous
      val(v.ui);
      ^~~
/Users/runner/work/wales_ish_otp_graph/wales_ish_otp_graph/pfaedle/src/util/json/Writer.cpp:78:14: note: candidate function
void Writer::val(bool v) {
             ^
/Users/runner/work/wales_ish_otp_graph/wales_ish_otp_graph/pfaedle/src/util/json/Writer.cpp:84:14: note: candidate function
void Writer::val(int v) {
             ^
/Users/runner/work/wales_ish_otp_graph/wales_ish_otp_graph/pfaedle/src/util/json/Writer.cpp:90:14: note: candidate function
void Writer::val(size_t v) {
             ^
/Users/runner/work/wales_ish_otp_graph/wales_ish_otp_graph/pfaedle/src/util/json/Writer.cpp:96:14: note: candidate function
void Writer::val(double v) {
             ^
1 error generated.
make[2]: *** [src/util/CMakeFiles/util.dir/json/Writer.cpp.o] Error 1
stupidpupil commented 2 years ago

Not a comprehensive test, I know, but here's some output of that branch, for Wales, United Kingdom:

map (Red are train lines, light green are trans-national bus services, grey are other bus services.)

GTFS outputs available in the artefacts of this GitHub Action run.

stupidpupil commented 2 years ago

And I've realised that of course I've not actually tested the JSON writing at all with that! Apologies.

stupidpupil commented 2 years ago

No idea if it actually tests the change, but here's some stats.json output from this branch:

{
  "statistics": {
    "dijkstra_iters": 135105054,
    "graph_dimension": {
      "bus": {
        "num_edges": 698388,
        "num_nodes": 301983
      },
      "coach": {
        "num_edges": 592832,
        "num_nodes": 255105
      },
      "ferry": {
        "num_edges": 110,
        "num_nodes": 51
      },
      "funicular": {
        "num_edges": 0,
        "num_nodes": 0
      },
      "gondola": {
        "num_edges": 0,
        "num_nodes": 0
      },
      "rail": {
        "num_edges": 16250,
        "num_nodes": 6295
      },
      "tram-subway": {
        "num_edges": 931,
        "num_nodes": 393
      }
    },
    "gtfs_avg_hop_dist": 555.6901883022,
    "gtfs_num_stations": 48877,
    "gtfs_num_trips": 116860,
    "num_edges_tot": 1308511.0000000000,
    "num_nodes_tot": 563827.0000000000,
    "num_trie_leafs": 10082,
    "num_tries": 6373,
    "peak-memory": "1.344 GB",
    "peak-memory-bytes": 1443545088,
    "time_read_gtfs": 5330.5460000000,
    "time_read_osm": 180301.7540000000,
    "time_solve": 115720.0530000000,
    "time_tot": 433332.5500000000
  }
}

From this GitHub Action run

patrickbr commented 2 years ago

MacOS compilation should now work with the latest commit :)