Compilation on Debian Wheezy fails - need to use libdb 4.8 #3686

Closed
kostaz opened this Issue Feb 16, 2014 · 11 comments

Comments

Projects
None yet
9 participants
@kostaz
Contributor

kostaz commented Feb 16, 2014

Running "./configure" reports the below error:
configure: error: Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore)

Naturally, libdb-4.8 is needed for wallet portability, hence, need to resolve this issue.
Please help (add instructions) on how to install Berkeley DB 4.8 manually.

The default Berkeley DB on Debian Wheezy is 5.1.

@gavinandresen

This comment has been minimized.

Show comment
Hide comment
@gavinandresen

gavinandresen Feb 16, 2014

Contributor

No, please visit the Berkeley DB website for instructions on installing BDB.

Contributor

gavinandresen commented Feb 16, 2014

No, please visit the Berkeley DB website for instructions on installing BDB.

@kostaz

This comment has been minimized.

Show comment
Hide comment
@kostaz

kostaz Feb 16, 2014

Contributor

I used the below instruction from http://www.peercointalk.org/index.php?topic=798.0 link:


Get db4.8 source, compile and install

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx
make
sudo make install

Tell your system where to find db4.8

export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include"
export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib"
ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so

ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/libdb_cxx-4.8.so

Unfortunately, the result is the same.

Contributor

kostaz commented Feb 16, 2014

I used the below instruction from http://www.peercointalk.org/index.php?topic=798.0 link:


Get db4.8 source, compile and install

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx
make
sudo make install

Tell your system where to find db4.8

export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include"
export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib"
ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so

ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/libdb_cxx-4.8.so

Unfortunately, the result is the same.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Feb 17, 2014

Member

There should be an option to tell ./configure where it can find the BDB headers / libraries but it doesn't seem to exist.

This is where it searches for the BDB 4.8 lib: https://github.com/bitcoin/bitcoin/blob/master/src/m4/bitcoin_find_bdb48.m4

Member

laanwj commented Feb 17, 2014

There should be an option to tell ./configure where it can find the BDB headers / libraries but it doesn't seem to exist.

This is where it searches for the BDB 4.8 lib: https://github.com/bitcoin/bitcoin/blob/master/src/m4/bitcoin_find_bdb48.m4

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Feb 17, 2014

Member

Can you try:

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"

It's ugly but the only way at this moment, I think.

Member

laanwj commented Feb 17, 2014

Can you try:

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"

It's ugly but the only way at this moment, I think.

@jeromecc

This comment has been minimized.

Show comment
Hide comment
@jeromecc

jeromecc May 30, 2014

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"

Might be ugly but it worked on Debian Wheezy. I followed link and instructions from kostaz (on february 16 's comment on this page) to successfully compile BerkeleyDB 4.8.

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"

Might be ugly but it worked on Debian Wheezy. I followed link and instructions from kostaz (on february 16 's comment on this page) to successfully compile BerkeleyDB 4.8.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj May 30, 2014

Member

@jeromecc There have been instructions in the UNIX build documentation for a while for building BDB 4.8:
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db
I suggest following those as they don't install BerkeleyDB system-wide.

Member

laanwj commented May 30, 2014

@jeromecc There have been instructions in the UNIX build documentation for a while for building BDB 4.8:
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db
I suggest following those as they don't install BerkeleyDB system-wide.

@anthonyettinger

This comment has been minimized.

Show comment
Hide comment
@anthonyettinger

anthonyettinger Feb 18, 2015

How hard is it to support latest version of db?

How hard is it to support latest version of db?

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Feb 18, 2015

Member

The issue is that newer versions of bdb produce wallet files which are not backward compatible, thus will not load in official binaries using 4.8. If you don't care about this, you can configure using --with-incompatible-bdb to force it to use a newer version. Another alternative is --disable-wallet to avoid the bdb dependency altogether.

Member

luke-jr commented Feb 18, 2015

The issue is that newer versions of bdb produce wallet files which are not backward compatible, thus will not load in official binaries using 4.8. If you don't care about this, you can configure using --with-incompatible-bdb to force it to use a newer version. Another alternative is --disable-wallet to avoid the bdb dependency altogether.

@jcoffland

This comment has been minimized.

Show comment
Hide comment
@jcoffland

jcoffland Jan 27, 2017

With checkinstall you can do this:

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx --prefix=/usr
make -j8
sudo checkinstall --fstrans=no --pkgversion=4.8.30 --pkgname=libdb-dev --nodoc -y

This puts bdb in the system as a Debian package where bitcoin can find it. Note, this only works if you don't already have another version of libbd-dev installed.

You can remove it later with:

sudo dpkg -r libdb-dev

jcoffland commented Jan 27, 2017

With checkinstall you can do this:

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx --prefix=/usr
make -j8
sudo checkinstall --fstrans=no --pkgversion=4.8.30 --pkgname=libdb-dev --nodoc -y

This puts bdb in the system as a Debian package where bitcoin can find it. Note, this only works if you don't already have another version of libbd-dev installed.

You can remove it later with:

sudo dpkg -r libdb-dev
@tsusanka

This comment has been minimized.

Show comment
Hide comment
@tsusanka

tsusanka Jul 4, 2018

sudo checkinstall --fstrans=no --pkgversion=4.8.30 --pgkname=libdb-dev --nodoc -y

Just a note, there is a typo in @jcoffland's last command. It should be

sudo checkinstall --fstrans=no --pkgversion=4.8.30 --pkgname=libdb-dev --nodoc -y

tsusanka commented Jul 4, 2018

sudo checkinstall --fstrans=no --pkgversion=4.8.30 --pgkname=libdb-dev --nodoc -y

Just a note, there is a typo in @jcoffland's last command. It should be

sudo checkinstall --fstrans=no --pkgversion=4.8.30 --pkgname=libdb-dev --nodoc -y

@fanquake

This comment has been minimized.

Show comment
Hide comment
@fanquake

fanquake Jul 4, 2018

Member

Thanks @tsusanka, I've edited the comment above as well.

Member

fanquake commented Jul 4, 2018

Thanks @tsusanka, I've edited the comment above as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment