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

install instructions? #433

Closed
ralyodio opened this issue Dec 9, 2016 · 7 comments
Closed

install instructions? #433

ralyodio opened this issue Dec 9, 2016 · 7 comments
Labels

Comments

@ralyodio
Copy link

ralyodio commented Dec 9, 2016

I'm using LinovDB which requires LevelDB but I don't see any instructions on how to install LevelDB on Linux.

https://github.com/Ivshti/linvodb3

@andreasbaumann
Copy link

I have similar thoughts on how to deal with leveldb in the
http://github.com/PatrickFrey/strus project.

A Linux distro survey of mine resulted in:

  • no leveldb: Centos 5/6/7, Fedora 23
  • no leveldb: SLES 11 and 12
  • Fedora 24, official leveldb-devel package is 1.12, can't recomend to use that
  • OpenSuSE Tumbleweed, OpenSuSE Leap 42.2, OpenSuSE 13.2: they have packages
    leveldb-devel, libleveldb1, 1.18, they are built against glib malloc and not tcmalloc
  • Debian 7, libleveldb-dev, libleveldb1, 0+20120530.gitdd0d562-1 (without tcmalloc),
    way old ant a git snapshot, don't use
  • Debian 8, libleveldb-dev, libleveldb1, 1.17 (without tcmalloc), maybe?
  • Ubuntu 16.10, libleveldb-dev, libleveldb1v5, 1.18 (without tcmalloc)
  • Ubuntu 16.04, libleveldb-dev, libleveldb1v5, 1.18 (without tcmalloc)
  • Ubuntu 14.04, libleveldb-dev, libleveldb1, 1.15 (without tcmalloc)

Currently I have a stub 'strusleveldb' project (based on leveldb 1.18) on OBS:

https://build.opensuse.org/project/monitor/home:andreas_baumann

This provides leveldb packages for platforms not supporting it or having
too old versions.

Why do some Linux distributions choose to use malloc instead of tcmalloc?

There seems to be a tradeoff between memory consumption and speed. So if
your software is embedded and running along other software maybe malloc is
better, if you are running dedicated servers with something using LevelDB as
a key-value storage os so, tcmalloc might be better.

In my experience packagers tend to think about a specific application of the
library (as in single-threaded sqlite inside RPM), so the package is not well
suited for general purpose use.

Alternatively you can also embedd leveldb, but this is more suitable for C++ projects as:

@eliethesaiyan
Copy link

eliethesaiyan commented Mar 2, 2017

i would appreciate a lot if someone could give instruction on how to install leveldb...building from source

@mightybigcar
Copy link

On Fedora 24, I did the following to build from source:

git clone https://github.com/google/leveldb.git
cd leveldb/
make
sudo scp out-static/lib* out-shared/lib* /usr/local/lib/
cd include/
sudo scp -r leveldb /usr/local/include/
sudo ldconfig

@shingjan
Copy link

On CentOS/RHEL, instructions:
git clone https://github.com/google/leveldb.git
cd leveldb && make
sudo cp include/leveldb /usr/local/include -rf
sudo cp out-shared/libleveldb.* /usr/local/lib

  • sudo vi /etc/ld.so.conf.d/usrlocallib.conf — let bash know you lib are here by adding the following lines
    /usr/local/lib
    sudo /sbin/ldconfig –v — flush the settings
    ./db_bench to see if LevelDB works

@iutinvg
Copy link

iutinvg commented Jun 7, 2017

LevelDB building instructions for iOS:

cd leveldb
make PLATFORM=IOS SHARED_OUTDIR=out-shared

Then

  • add proper static library file into your Xcode project (leveldb/ios-out-universal/*.a)
  • add headers or add a path to them in Build Settings (../leveldb/include)

A couple of notices:

@rofl0r
Copy link

rofl0r commented Mar 2, 2018

since google doesn't give a wet crap about its users, here is the patch from debian adding an install target to the Makefile:

Description: Improvements to the Makefile.
 Replace INSTALL_PATH with the most commonly use DESTDIR variable.
 Add an 'install' target.
Author: Alessio Treglia <alessio@debian.org>
Forwarded: http://code.google.com/p/leveldb/issues/detail?id=27
---
 Makefile |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- leveldb.orig/Makefile
+++ leveldb/Makefile
@@ -2,6 +2,10 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file. See the AUTHORS file for names of contributors.

+PREFIX ?= /usr/local
+LIBDIR ?= lib
+INCLUDEDIR ?= include
+
 #-----------------------------------------------
 # Uncomment exactly one of the lines labelled (A), (B), and (C) below
 # to switch between compilation modes.
@@ -140,6 +144,17 @@ endif  # PLATFORM_SHARED_EXT

 all: $(SHARED_LIBS) $(SHARED_PROGRAMS) $(STATIC_OUTDIR)/libleveldb.a $(STATIC_OUTDIR)/libmemenv.a $(STATIC_PROGRAMS)

+install: all
+       install -d $(DESTDIR)$(PREFIX)/$(LIBDIR)
+       install -d $(DESTDIR)$(PREFIX)/$(INCLUDEDIR)/leveldb
+       install -m 0644 $(STATIC_OUTDIR)/libleveldb.a $(DESTDIR)$(PREFIX)/$(LIBDIR)
+ifneq ($(PLATFORM_SHARED_EXT),)
+       install -m 0644 $(SHARED_OUTDIR)/$(SHARED_LIB3) $(DESTDIR)$(PREFIX)/$(LIBDIR)
+       cd $(DESTDIR)$(PREFIX)/$(LIBDIR) && ln -sf $(SHARED_LIB3) $(SHARED_LIB2)
+       cd $(DESTDIR)$(PREFIX)/$(LIBDIR) && ln -sf $(SHARED_LIB3) $(SHARED_LIB1)
+endif
+       install -m 0644 include/leveldb/* $(DESTDIR)$(PREFIX)/$(INCLUDEDIR)/leveldb
+
 check: $(STATIC_PROGRAMS)
        for t in $(notdir $(TESTS)); do echo "***** Running $$t"; $(STATIC_OUTDIR)/$$t || exit 1; done

taken from https://packages.debian.org/buster/libleveldb-dev -> http://http.debian.net/debian/pool/main/l/leveldb/leveldb_1.20-2.debian.tar.xz

@pwnall
Copy link
Member

pwnall commented Mar 8, 2019

The CMake-based build supports installing. We don't use this, so the code is fairly untested. Please file bugs if you have problems on specific platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants