Skip to content

Fix build on FreeBSD.#7206

Merged
DennisOSRM merged 1 commit intoProject-OSRM:masterfrom
aisakovic:master
Aug 25, 2025
Merged

Fix build on FreeBSD.#7206
DennisOSRM merged 1 commit intoProject-OSRM:masterfrom
aisakovic:master

Conversation

@aisakovic
Copy link
Copy Markdown
Contributor

Issue

Building the release branch (v6.0.0) fails on FreeBSD.

This is the error:

/usr/ports/www/osrm-backend/work/osrm-backend-6.0.0/src/tools/io-benchmark.cpp:112:65: error: use of undeclared identifier 'write_1gb_stop'
  112 |         osrm::util::Log(logDEBUG) << "writing raw 1GB took " << TIMER_SEC(write_1gb) << "s";
      |                                                                 ^
/usr/ports/www/osrm-backend/work/osrm-backend-6.0.0/include/util/timing_util.hpp:20:60: note: expanded from macro 'TIMER_SEC'
   20 |      std::chrono::duration_cast<std::chrono::microseconds>(_X##_stop - _X##_start).count())
      |                                                            ^
<scratch space>:309:1: note: expanded from here
  309 | write_1gb_stop
      | ^
/usr/ports/www/osrm-backend/work/osrm-backend-6.0.0/src/tools/io-benchmark.cpp:112:65: error: use of undeclared identifier 'write_1gb_start'
/usr/ports/www/osrm-backend/work/osrm-backend-6.0.0/include/util/timing_util.hpp:20:72: note: expanded from macro 'TIMER_SEC'
   20 |      std::chrono::duration_cast<std::chrono::microseconds>(_X##_stop - _X##_start).count())
      |                                                                        ^
<scratch space>:310:1: note: expanded from here
  310 | write_1gb_start
      | ^
/usr/ports/www/osrm-backend/work/osrm-backend-6.0.0/src/tools/io-benchmark.cpp:114:44: error: use of undeclared identifier 'write_1gb_stop'
  114 |                           << 1024 * 1024 / TIMER_SEC(write_1gb) << "MB/sec";
      |                                            ^
/usr/ports/www/osrm-backend/work/osrm-backend-6.0.0/include/util/timing_util.hpp:20:60: note: expanded from macro 'TIMER_SEC'
   20 |      std::chrono::duration_cast<std::chrono::microseconds>(_X##_stop - _X##_start).count())
      |                                                            ^
<scratch space>:311:1: note: expanded from here
  311 | write_1gb_stop
      | ^
/usr/ports/www/osrm-backend/work/osrm-backend-6.0.0/src/tools/io-benchmark.cpp:114:44: error: use of undeclared identifier 'write_1gb_start'
/usr/ports/www/osrm-backend/work/osrm-backend-6.0.0/include/util/timing_util.hpp:20:72: note: expanded from macro 'TIMER_SEC'
   20 |      std::chrono::duration_cast<std::chrono::microseconds>(_X##_stop - _X##_start).count())
      |                                                                        ^
<scratch space>:312:1: note: expanded from here
  312 | write_1gb_start
      | ^
4 errors generated. 

The issue is that calls to the TIMER_START and TIMER_STOP macros are required in order to initialize the values of write_1gb_start and write_1gb_stop respectively. Before this PR, these calls occurred only for __APPLE__ and __linux__ features in io-benchmark.cpp.

@DennisOSRM DennisOSRM merged commit 7d46e41 into Project-OSRM:master Aug 25, 2025
21 checks passed
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.

3 participants