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

Got message "Please install gflags to run rocksdb tools" while running ./db_bench #1775

Closed
JevonQ opened this issue Jan 14, 2017 · 9 comments

Comments

@JevonQ
Copy link
Contributor

JevonQ commented Jan 14, 2017

I just compiled RocksDB on CentOS 7.1 yesterday with no errors, but when I try to run ./db_bench command I got the message "Please install gflags to run rocksdb tools". I built and installed gflags from scratch. Since the compilation of RocksDB have succeeded, so I think the installation of gflags succeeds as well.

I also tried to google the problem but with no luck, can anyone help me out of this?

@IslamAbdelRahman
Copy link
Contributor

RocksDB can compile even if gflags don't exist, please try re-compiling after installing gflags

@JevonQ
Copy link
Contributor Author

JevonQ commented Mar 25, 2017

@IslamAbdelRahman, thanks for your reply. I still get the same error, as follows

[root@localhost rocksdb-5.1.2]# ./db_bench --benchmarks=readrandomwriterandom --key_size=512 --value_size=3584 --open_files=65528 --num_levels=3 --max_bytes_for_level_base=629145600 --target_file_size_multiplier=10 --block_size=131072 --compaction_pri=3 --target_file_size_base=1048576 --threads=1 --num=500000
Please install gflags to run rocksdb tools

[root@localhost rocksdb-5.1.2]# rpm -qa|grep gflags
gflags-devel-2.1.1-6.el7.x86_64
gflags-2.1.1-6.el7.x86_64

@JevonQ
Copy link
Contributor Author

JevonQ commented Mar 25, 2017

Finally, I noticed the following comments in file build_tools/build_detect_platform,
" Using gflags in rocksdb:
Our project depends on gflags, which requires users to take some extra steps
before they can compile the whole repository:

  1. Install gflags. You may download it from here:
    https://gflags.github.io/gflags/ (Mac users can brew install gflags)
  2. Once installed, add the include path for gflags to your CPATH env var and
    the lib path to LIBRARY_PATH. If installed with default settings, the lib
    will be /usr/local/lib and the include path will be /usr/local/include"

After setting CPATH and LIBRARY_PATH, I can run db_bench now. I'll update the installation document to illustrate this.

@JevonQ
Copy link
Contributor Author

JevonQ commented Mar 25, 2017

Close this issue as it is resolved.

@JevonQ JevonQ closed this as completed Mar 25, 2017
JevonQ added a commit to JevonQ/rocksdb that referenced this issue Mar 30, 2017
Summary:
Add a notice on gflags installation to help people build and install
RocksDB from source code correctly.
Please see facebook#1775
facebook-github-bot pushed a commit that referenced this issue Apr 4, 2017
Summary:
Add a notice on gflags installation to help people build and install
RocksDB from source code correctly.
Please see #1775
Closes #2061

Differential Revision: D4831323

Pulled By: yiwu-arbug

fbshipit-source-id: 0df1f0e
@kyleyuanmh
Copy link

Is there some solution to solve this problem??

@rba4062
Copy link

rba4062 commented Jul 23, 2019

@JevonQ Were you able to solve this issue. If yes, which OS version and how. I have tried several things mentioned in the readme etc, but unable to find the issue here.

I am trying to compile it on Ubuntu 18.04 and was using the following command

CPATH=/usr/include/gflags/ LIBRARY_PATH=${LIBRARY_PATH}:/usr/lib/x86_64-linux-gnu/ make -j 4 db_bench

Gflags is correctly installed in my machine

ls /usr/lib/x86_64-linux-gnu/libgflags.so -la 
lrwxrwxrwx 1 root root 16 Aug  6  2017 /usr/lib/x86_64-linux-gnu/libgflags.so -> libgflags.so.2.2

@csyjia
Copy link

csyjia commented Sep 2, 2019

Please remember to "make clean" before "make" after installing gflags.

@Kodairoad
Copy link

I've seen this error too. but my situation was bit different.
I am not supposed to run “mkdir build && cd build” but just “make release” from main folder. I kept digging into gflags and its nothing to do with it.

@lcoon815
Copy link

lcoon815 commented Oct 1, 2021

@JevonQ I am having this problem now but i do not understand how to set the CPATH and LIBRARY_PATH. Could you posted the step here? I am new to RocksDB.

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

No branches or pull requests

7 participants