Skip to content

Commit

Permalink
README updates in light of the leveldb shared library release
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhodges committed Mar 31, 2012
1 parent 8ce6ce8 commit 78d2e41
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,28 @@ Questions answered at `golang-nuts@googlegroups.com`.

## Building

You'll need the shared library build of LevelDB installed on your
machine. Right now, that means applying my [latest patch for LevelDB's
Makefile](http://code.google.com/p/leveldb/issues/detail?id=27#c14).
You'll need the shared library build of
[LevelDB](http://code.google.com/p/leveldb/) installed on your machine. The
current LevelDB will build it by default.

Now, suppose you built the shared LevelDB library in /path/to/lib and the
headers were installed in /path/to/include. To install levigo remotely, you'll
run:
Now, if you build LevelDB and put the shared library and headers in one of the
standard places for your OS, you'll be able to simply run:

go get github.com/jmhodges/levigo

But, suppose you put the shared LevelDB library somewhere weird like
/path/to/lib and the headers were installed in /path/to/include. To install
levigo remotely, you'll run:

CGO_CFLAGS="-I/path/to/leveldb/include" CGO_LDFLAGS="-L/path/to/lib" go get github.com/jmhodges/levigo

and there you go.

Of course, the rules apply locally with `go build` instead of `go get`.

## Caveats

Comparators and WriteBatch iterators must be written in C in your own library.
Comparators and WriteBatch iterators must be written in C in your own
library. This is slightly better when you realize you'll have the LevelDB C
API available to your in your client package by including levigo and its
build.

0 comments on commit 78d2e41

Please sign in to comment.