Skip to content

Instantly share code, notes, and snippets.

@papaben
Last active December 31, 2023 13:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save papaben/135caaec084c0bc32813a2b2cba280c1 to your computer and use it in GitHub Desktop.
Save papaben/135caaec084c0bc32813a2b2cba280c1 to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
# Installs RocksDB
# https://github.com/facebook/rocksdb/blob/master/INSTALL.md
# http://pyrocksdb.readthedocs.io/en/v0.4/installation.html
##
set -e
set -x
sudo yum groupinstall -y "Development Tools"
sudo yum --enablerepo=epel install -y snappy{-devel,} zlib{-devel,} bzip2-{devel,libs} gflags{-devel,} lz4-devel libsanitizer libzstd{-devel,}
export CPATH=/usr/include
export LIBRARY_PATH=/usr/lib64
# Our versions of gcc is more strict by default, we need to disable that!
export EXTRA_CFLAGS='-Wimplicit-fallthrough=0 -Wformat-truncation=0'
export EXTRA_CXXFLAGS='-Wimplicit-fallthrough=0 -Wformat-truncation=0'
export DEBUG_LEVEL=0
declare rocksVersion="5.10.2"
wget -O rocksdb-${rocksVersion}.tar.gz https://github.com/facebook/rocksdb/archive/v${rocksVersion}.tar.gz
tar -xzf rocksdb-${rocksVersion}.tar.gz
pushd rocksdb-${rocksVersion}
make shared_lib
sudo make install-shared INSTALL_PATH=/usr
# https://github.com/facebook/rocksdb/issues/2729
make clean
# We call these directly from python
make ldb sst_dump
sudo cp ldb /usr/local/bin
sudo cp sst_dump /usr/local/bin
popd
# RocksDB installs into the wrong lib (lib not lib64), so we must copy
sudo cp /usr/lib/librocksdb.so* /usr/lib64/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment