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

Support for building against system LevelDB #2241

wants to merge 2 commits into from


Copy link

@luke-jr luke-jr commented Jan 30, 2013

Status: Tests succeed, looks complete.

This is based on top of #2243 (LevelDB build bugfixes).

This is necessary for proper downstream distro packaging, and useful for people who have LevelDB installed for other reasons anyway. Undocumented to infer an unsupported status, but I could add a brief blurb if that's desirable. Only implemented for Linux (ie, not makefile.) for now - I assume OSX and Windows won't be packaging LevelDB/Bitcoin themselves anytime soon. Note that this does NOT remove the copied leveldb from the code, and will still build with that by default.

To test with system LevelDB:

  1. Optional: Delete or move src/leveldb so any attempt to use it errors explicitly
  2. Install LevelDB on your system as a shared library
  3. qmake USE_SYSTEM_LEVELDB=1 && make
  4. cd src
  5. make -f makefile.unix USE_SYSTEM_LEVELDB=1 bitcoind
  6. make -f makefile.unix USE_SYSTEM_LEVELDB=1 test_bitcoin

Step 6 (test_bitcoin) will fail if your system LevelDB does not support memenv. This is expected behaviour.

To test included LevelDB still works:

  1. Restore src/leveldb
  2. Remove system LevelDB library/package
  3. qmake && make
  4. cd src
  5. make -f makefile.unix bitcoind
  6. make -f makefile.unix test_bitcoin

Bitcoin-Qt and bitcoind no longer include the LevelDB memenv module (only test_bitcoin uses it) - saves 423 KB

Copy link

Debian is at least looking at including memenv, won't happen until after Wheezy is released though:

Copy link
Member Author

luke-jr commented Feb 26, 2013

@maqifrnswa memenv is only needed for test_bitcoin.

Copy link

jgarzik commented Jun 19, 2013


Though this will certainly need updating, pending autotools work

Copy link

sipa commented Jun 19, 2013

I'd delay this until after autotoolification, as it would need to be redone from scratch otherwise anyway.

However, all but test_bitcoin not linking against libmemenv.a seems meaningful by itself.

Copy link
Member Author

luke-jr commented Jul 16, 2013

In the meantime, I fixed a bug building test_bitcoin against system leveldb (memenv.h is not in a subdirectory)

Copy link

Automatic sanity-testing: FAILED BUILD/TEST, see for binaries and test log.

This could happen for one of several reasons:

  1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in contrib/test-scripts)
  2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
  3. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
  4. The test suite fails on either Linux i386 or Win32
  5. The block test-cases failed (lookup the first bNN identifier which failed in

If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here.

This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at
Contact BlueMatt on freenode if something looks broken.

Copy link

Diapolo commented Oct 10, 2013

This needs rebase because of Autotools, dunno if it's even required...

Copy link

laanwj commented Oct 16, 2013

Closing this as autotools will need a completely different solution.

@laanwj laanwj closed this Oct 16, 2013
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

7 participants