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

Microbenchmark is not compatible with 1.6.x Google benchmark #9489

Open
kloczek opened this issue Feb 2, 2022 · 10 comments
Open

Microbenchmark is not compatible with 1.6.x Google benchmark #9489

kloczek opened this issue Feb 2, 2022 · 10 comments
Labels
Build build, makefile, cmake, scripts dependencies Pull requests that update a dependency file up-for-grabs Up for grabs

Comments

@kloczek
Copy link

kloczek commented Feb 2, 2022

gcc 12.0.0 from fedora rawhide

[ 99%] Building CXX object microbench/CMakeFiles/db_basic_bench.dir/db_basic_bench.cc.o
cd /home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/x86_64-redhat-linux-gnu/microbench && /usr/bin/g++ -DGFLAGS=1 -DHAVE_PCLMUL -DHAVE_SSE42 -DLZ4 -DNUMA -DOS_LINUX -DROCKSDB_FALLOCATE_PRESENT -DROCKSDB_LIB_IO_POSIX -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_PLATFORM_POSIX -DROCKSDB_PTHREAD_ADAPTIVE_MUTEX -DROCKSDB_RANGESYNC_PRESENT -DROCKSDB_SCHED_GETCPU_PRESENT -DROCKSDB_SUPPORT_THREAD_LOCAL -DZLIB -DZSTD -I//include -I/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2 -I/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/include -I/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/third-party/folly -isystem /home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/third-party/gtest-1.8.1/fused-src -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -W -Wextra -Wall -pthread -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -fno-omit-frame-pointer -momit-leaf-frame-pointer -march=native -fno-builtin-memcmp -DNDEBUG -std=gnu++11 -MD -MT microbench/CMakeFiles/db_basic_bench.dir/db_basic_bench.cc.o -MF CMakeFiles/db_basic_bench.dir/db_basic_bench.cc.o.d -o CMakeFiles/db_basic_bench.dir/db_basic_bench.cc.o -c /home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc
[100%] Built target ribbon_bench
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::DBPut(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:264:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  264 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:267:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  267 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:285:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  285 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::ManualCompaction(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:348:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  348 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:351:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  351 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:392:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  392 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::ManualFlush(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:468:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  468 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:471:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  471 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:490:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  490 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::DBGet(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:543:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  543 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:546:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  546 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:597:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  597 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::SimpleGetWithPerfContext(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:642:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  642 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:645:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  645 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:750:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  750 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::IteratorSeek(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:858:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  858 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:861:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  861 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:906:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  906 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::IteratorNext(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:952:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  952 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:955:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
  955 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1000:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1000 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::IteratorNextWithPerfContext(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1026:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1026 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1029:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1029 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1101:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1101 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::IteratorPrev(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1120:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1120 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1123:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1123 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1168:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1168 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc: In function ‘void rocksdb::PrefixSeek(benchmark::State&)’:
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1213:33: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1213 |   auto rnd = Random(301 + state.thread_index);
      |                           ~~~~~~^~~~~~~~~~~~
      |                                             ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1216:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1216 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
/home/tkloczko/rpmbuild/BUILD/rocksdb-6.28.2/microbench/db_basic_bench.cc:1260:13: error: invalid use of member function ‘int benchmark::State::thread_index() const’ (did you forget the ‘()’ ?)
 1260 |   if (state.thread_index == 0) {
      |       ~~~~~~^~~~~~~~~~~~
      |                         ()
make[2]: *** [microbench/CMakeFiles/db_basic_bench.dir/build.make:79: microbench/CMakeFiles/db_basic_bench.dir/db_basic_bench.cc.o] Error 1
@hx235
Copy link
Contributor

hx235 commented Feb 4, 2022

I guess somehow you are using the latest google benchmark/benchmark. h in the build since that header recently changed from public const int thread_index; to int thread_index() const { return thread_index_; } according to their PR while RocksDB hasn't picked that up.

Would you be able to utilize make or cmake build system instead of building directly with g++ to make sure library version is correct? For example, in your rocksdb folder do make db_basic_bench or make -jN db_basic_bench (where N is the number of cores if you want to parallelize the build)? See https://github.com/facebook/rocksdb/blob/main/INSTALL.md#compilation for more info on building with make or cmake.

@hx235 hx235 added waiting Waiting for a response from the issue creator. question labels Feb 4, 2022
@kloczek
Copy link
Author

kloczek commented Feb 4, 2022

I'm using google benchmark 1.6.1and I'm building rocksdb using cmake.

@hx235
Copy link
Contributor

hx235 commented Feb 5, 2022

1.6.1

Is there any chance you could install/use a 1.5.5 version as a quick fix if you don't necessarily need to use 16.1? 1.5.5 version works fine with me.

@kloczek
Copy link
Author

kloczek commented Feb 5, 2022

All other packages in my diseo have no problems with that version.
So .. looks like rocksdb is not ready yet for that version of the google benchmark? (if yess feesl free to change subject of this issue ticket)

@hx235
Copy link
Contributor

hx235 commented Feb 5, 2022

Yeah and there isn’t any immediate plan to make change on Rocksdb side. But I tried to clarify things a bit here #9505

Is there anything else I can help you with before closing the issue?

@kloczek
Copy link
Author

kloczek commented Feb 5, 2022

Does it mean that you are not going to adapt rocksdb code to be able use it with latest google benchmark? 🤔

@hx235
Copy link
Contributor

hx235 commented Feb 5, 2022

We might in the future - I was just saying there isn’t an intermediate plan. The INSTALL file change is there for more clarity right now.

(And I changed the issue title.)

@hx235 hx235 changed the title 6.28.2: build fails with gcc 12.0.0 RockDB not compatible with 1.6.1 Goggle benchmark Feb 5, 2022
@hx235 hx235 changed the title RockDB not compatible with 1.6.1 Goggle benchmark RocksDB not compatible with 1.6.1 Goggle benchmark Feb 5, 2022
@hx235 hx235 changed the title RocksDB not compatible with 1.6.1 Goggle benchmark RocksDB not compatible with 1.6.1 Google benchmark Feb 5, 2022
@ajkr ajkr added enhancement up-for-grabs Up for grabs and removed question waiting Waiting for a response from the issue creator. labels Feb 6, 2022
facebook-github-bot pushed a commit that referenced this issue Feb 7, 2022
Summary:
**Context:**
Google benchmark [v1.6.0](https://github.com/google/benchmark/releases/tag/v1.6.0) introduced a breaking change "`introduce accessorrs for public data members (https://github.com/google/benchmark/pull/1208)`" that will fail RocksDB build of microbench developed based on previous code. For example, #9489.

**Summary:**
Clarify the maximum version of Google benchmark needed.

Pull Request resolved: #9505

Test Plan: CI

Reviewed By: ajkr

Differential Revision: D34023447

Pulled By: hx235

fbshipit-source-id: 0128ffc31485f2d752ab2116771f6ae53231fcd7
@jay-zhuang
Copy link
Contributor

Thanks @hx235 for calcifying it in the doc. Yeah, unfortunately it's because Google benchmark introduced a non-backward compatible change in 1.6.0: google/benchmark@dc1a971 and some platforms (like ubuntu-20.04) are not yet upgraded to the 1.6.x version, which blocks us from upgrading. We will upgrade once most of the platforms are having the 1.6.x google benchmark.

By default, micro-benchmark is disabled, unless you explicitly enable that by -DWITH_BENCHMARK=1. So if you do want to run mico-benchmark, currently you have to use google benchmark <= 1.5.5.

@jay-zhuang jay-zhuang added Build build, makefile, cmake, scripts dependencies Pull requests that update a dependency file and removed enhancement up-for-grabs Up for grabs labels Feb 7, 2022
@jay-zhuang jay-zhuang changed the title RocksDB not compatible with 1.6.1 Google benchmark Microbenchmark is not compatible with 1.6.x Google benchmark Feb 7, 2022
@kloczek
Copy link
Author

kloczek commented Mar 12, 2022

Just tested 7.0.1 and looks like issue still is around .. 🤔

@ajkr ajkr added the up-for-grabs Up for grabs label Mar 12, 2022
@jay-zhuang
Copy link
Contributor

Just tested 7.0.1 and looks like issue still is around .. 🤔

It's because a non-backward compatible change from google benchmark. If we upgrade, then it will break the build for the user with 1.5.x. And for example Ubuntu 20.0 is still using google benchmark 1.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build build, makefile, cmake, scripts dependencies Pull requests that update a dependency file up-for-grabs Up for grabs
Projects
None yet
Development

No branches or pull requests

4 participants