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

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

Closed
kostaz opened this issue Feb 16, 2014 · 15 comments
Closed

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

kostaz opened this issue Feb 16, 2014 · 15 comments

Comments

@kostaz
Copy link
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
Copy link
Contributor

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

@kostaz
Copy link
Contributor Author

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
Copy link
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
Copy link
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
Copy link

./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
Copy link
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
Copy link

How hard is it to support latest version of db?

@luke-jr
Copy link
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
Copy link

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
Copy link

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
Copy link
Member

fanquake commented Jul 4, 2018

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

@potadibyo
Copy link

Thanks dear @fanquake and dear @jcoffland but checkinstall is not a command is writting

@psygoa
Copy link

psygoa commented Mar 11, 2019

its ok!
./autogen.sh && ./configure --with-incompatible-bdb && make

@cryptozeny
Copy link

same here on ubuntu 16.04. is this safe with this command?

./configure --with-incompatible-bdb

@maflcko
Copy link
Member

maflcko commented Apr 13, 2019

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Apr 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests