Now build and test Germany:


Bash

cat builder/src/build_index.cpp | ssh node3 "cat > /tmp/traccar-geocoder/builder/src/build_index.cpp" && ssh node3 "cd /tmp/traccar-geocoder/builder/build && make -j\$(nproc) 2>&1 | tail -3 && rm -rf /tmp/de-prof && mkdir -p /tmp/de-prof && /tmp/traccar-geocoder/builder/build/build-index /tmp/de-prof ~/pbf/germany.osm.pbf --parallel-admin 2>&1 | grep '\\['" 2>&1

Build and run Germany with sub-phase timers


make[2]: *** [CMakeFiles/build-index.dir/build.make:79: CMakeFiles/build-index.dir/src/build_index.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/build-index.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
  [5.4s] Pass 1: relation scanning
  [16.3s] Pass 2: node processing
  [17.7s] Pass 3: way processing
  DEBUG '55546': ways: [w197101541 first=323927596 last=738639324 n=23] [w83390312 first=323540614 last=323927596 n=9] [w103519615 first=323919977 last=323540614 n=18] [w82453211 first=324144479 last=323919977 n=22] [w82854344 first=323737093 last=324144479 n=8] [w82854343 first=323784639 last=323737093 n=7] [w82453274 first=323780057 last=323784639 n=26] [w82854356 first=959665468 last=323780057 n=12] [w82453061 first=323487874 last=959665468 n=2] [w361392255 first=323909831 last=323487874 n=19] [w361478038 first=3658742726 last=323909831 n=3] [w83115016 first=323669620 last=3658742726 n=2] [w83115024 first=323704447 last=323669620 n=13] [w56448456 first=323573335 last=323704447 n=2] [w83115034 first=323909506 last=323573335 n=7] [w82453250 first=323401725 last=323909506 n=5] [w56448464 first=323815636 last=323401725 n=7] [w1483473381 first=323815636 last=707478473 n=12] [w56448380 first=707478473 last=707478654 n=23] [w1483472544 first=3567905940 last=707478654 n=14] [w56448434 first=707478639 last=3567905940 n=28] [w56448471 first=707478639 last=707478477 n=5] [w56448407 first=707478477 last=471546024 n=7] [w528981686 first=471546024 last=1350759928 n=3] [w561236996 first=1350759928 last=1351705259 n=15] [w528981687 first=5139522515 last=1674576244 n=3] [w82825205 first=1674576244 last=707478678 n=19] [w1066405302 first=707478678 last=1675165086 n=2] [w56448447 first=1675165086 last=707478696 n=13] [w458921334 first=4548475758 last=707478696 n=9] [w56448381 first=707478517 last=4548475758 n=2] [w561236986 first=5412056105 last=707478517 n=6] [w56448426 first=707478448 last=5412056105 n=17] [w56448410 first=9792474559 last=707478448 n=3] [w1066405304 first=324139588 last=9792474559 n=3] [w83831219 first=324129352 last=324139588 n=10] [w82854354 first=323433111 last=324129352 n=25] [w1066405307 first=9846633421 last=323433111 n=17] [w29412137 first=323931327 last=9846633421 n=24] [w82854348 first=567185861 last=323931327 n=50] [w58282350 first=323634440 last=567185861 n=13] [w195958923 first=738639324 last=323634440 n=3]
  DEBUG '55543': ways: [w82825295 first=707478661 last=471546024 n=45] [w528981686 first=471546024 last=1350759928 n=3] [w561236996 first=1350759928 last=1351705259 n=15] [w528981687 first=5139522515 last=1674576244 n=3] [w82825205 first=1674576244 last=707478678 n=19] [w1066405302 first=707478678 last=1675165086 n=2] [w56448447 first=1675165086 last=707478696 n=13] [w56448444 first=707478696 last=963915167 n=5] [w1105647627 first=963915167 last=3660345646 n=8] [w1455858600 first=3660345646 last=10117529738 n=3] [w1483477594 first=10117529738 last=10117524960 n=2] [w82825119 first=10117524960 last=963916503 n=21] [w82825081 first=963916503 last=707478661 n=10]
  DEBUG 'Düren': ways: [w438390200 first=428892823 last=4635989132 n=41] [w438397122 first=4635989132 last=4361440131 n=52]
  DEBUG 'Derichsweiler': ways: [w438397123 first=4361440131 last=4361440133 n=3] [w564331877 first=5437479801 last=4361440133 n=24]
  DEBUG 'Hehlingen': ways: [w101559114 first=323472371 last=323654339 n=16] [w1447944003 first=323945148 last=323654339 n=18] [w1448056004 first=323945148 last=13285066168 n=78] [w1448056003 first=13285066170 last=13285066176 n=7] [w283748979 first=13285066176 last=13285066239 n=64] [w1465686506 first=13285066239 last=13285066279 n=41] [w1447964139 first=13285066279 last=13285066293 n=15] [w1447964141 first=13285066293 last=13285049425 n=9] [w1466781881 first=13285049425 last=13285049499 n=75] [w101559287 first=13285049499 last=13285066069 n=71] [w1466781877 first=13285066069 last=323472371 n=8]
  DEBUG 'Neuhaus-Reislingen': ways: [w1448056000 first=13286085007 last=324014593 n=34] [w186015071 first=323945148 last=324014593 n=42] [w1448056004 first=323945148 last=13285066168 n=78] [w1448056003 first=13285066170 last=13285066176 n=7] [w1465686504 first=13285066176 last=13286085229 n=33] [w1448056002 first=13286085229 last=13286085123 n=107] [w1448056006 first=13286085123 last=13286085007 n=89]
  [33.9s] Admin assembly
  [30.7s] S2 cell computation
  [3.7s] Deduplication
  [7.6s] Index file writing


Build failed (compile error) but the old binary ran. The sub-timers didn't show — likely the `_wt` variable is in the wrong scope since it's inside `write_index` but the build failed before it was compiled. Let me fix the compile error first.


ssh node3 "cd /tmp/traccar-geocoder/builder/build && make 2>&1 | grep error: | head -3" 2>&1

Check compile error


/tmp/traccar-geocoder/builder/src/build_index.cpp:1849:41: error: ‘_wt’ was not declared in this scope


  1843→        std::cerr << "geo index: " << sorted_geo_cells.size() << " cells ("
  1844→                  << data.ways.size() << " ways, "
  1845→                  << data.addr_points.size() << " addrs, "
  1846→                  << data.interp_ways.size() << " interps)" << std::endl;
  1847→    }
  1848→
  1849→    log_phase("  Write: geo_cells.bin", _wt);
  1850→    // Write admin cell index, raw data files, and admin polygons in parallel
  1851→    auto admin_future = std::async(std::launch::async, [&] {
  1852→        write_cell_index(output_dir + "/admin_cells.bin", output_dir + "/admin_entries.bin", data.cell_to_admin);
  1853→        std::cerr << "admin index: " << data.cell_to_admin.size() << " cells, " << data.admin_polygons.size() << " polygons" << std::endl;
  1854→    });

        std::cerr << "geo index: " << sorted_geo_cells.size() << " cells ("
                  << data.ways.size() << " ways, "
                  << data.addr_points.size() << " addrs, "
                  << data.interp_ways.size() << " interps)" << std::endl;
    }

    log_phase("  Write: geo_cells.bin", _wt);
    // Write admin cell index, raw data files, and admin polygons in parallel
    auto admin_future = std::async(std::launch::async, [&] {
        write_cell_index(output_dir + "/admin_cells.bin", output_dir + "/admin_entries.bin", data.cell_to_admin);
        std::cerr << "admin index: " << data.cell_to_admin.size() << " cells, " << data.admin_polygons.size() << " polygons" << std::endl;
    });


The `_wt` was declared inside the `if (write_streets)` block (line 1801) but the log_phase at line 1849 is outside that block (after closing `}`). Let me move _wt declaration up.


Edit

        // Write entry files in parallel (returns positional offset vectors, not hash maps)
        auto _wt = std::chrono::steady_clock::now();

// Write entry files in parallel (returns positional offset vectors, not hash maps)