How to install LevelDB on Ubuntu 16.04

# compile

mkdir -p "$HOME/tmp/tar_gz"
cd "$HOME/tmp/tar_gz"
if [[ ! -f "$HOME/tmp/tar_gz/leveldb-1.20.tar.gz" ]]; then
  wget -O "$HOME/tmp/tar_gz/leveldb-1.20.tar.gz" "https://github.com/google/leveldb/archive/v1.20.tar.gz"
fi
tar xf "$HOME/tmp/tar_gz/leveldb-1.20.tar.gz"
cd "$HOME/tmp/tar_gz/leveldb-1.20"
make clean
make distclean
make

# install

cd "$HOME/tmp/tar_gz/leveldb-1.20"
sudo scp -r out-static/lib* out-shared/lib* "/usr/local/lib"
cd "$HOME/tmp/tar_gz/leveldb-1.20/include"
sudo scp -r leveldb "/usr/local/include"
sudo ldconfig

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.