Skip to content

Fix build on FreeBSD. #7206

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

aisakovic
Copy link

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.

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.

2 participants