Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: CoinHeavy on April 28, 2014, 05:49:40 PM



Title: Centos 6.5 and Bitcoin
Post by: CoinHeavy on April 28, 2014, 05:49:40 PM
I am trying to compile bitcoin from source on Centos 6.5.

I believe that I am most of the way there.  I seem to have successfully compiled bitcoind, however, when I try to run it, I get the following:

Code:
./bitcoind: error while loading shared libraries: libdb_cxx-4.8.so: cannot open shared object file: No such file or directory

I have tried the following from here:
https://github.com/bitcoin/bitcoin/issues/2998

Code:
Since there is no libdb++ in official CentOs repo, I've done the following to fix this problem
1. Download sources of BerkeleyDb 4.8
2. Go to /build_unix/
3. ../dist/configure --prefix=/usr/local --enable-cxx
4. make
5. (as root) make install

And then:
Code:
add to ./src/m4/bitcoin_find_bdb48.m4:

  bdbdirlist=/path/to/compiled/db-4.8.30.NC/build_unix/build/include

I have also tried:
Code:
This can be fixed by doing the following:
cd ~/db-4.8.30.NC/build_unix make sudo make install
Check that there is a BerkeleyDB.4.8 folder in /usr/local
ls /usr/local
then create a symbolic link:
ln -s /usr/local/BerkeleyDB.4.8 /usr/include/db4.8
and then do:
ln -s /usr/local/db4.8/include/* /usr/include ln -s /usr/local/db4.8/lib/* /usr/lib

Unfortunately, I can't seem to get BerkeleyDB.4.8 in /usr/local to appear.

I have looked via yum:
yum search d4
only shows a handful of options.  db4-cxx.x86_64 is the likeliest candidate but when trying to install it I see that it is already installed and a 4.7.... version is referenced.

So, somehow I have compiled bitcoin on this machine but done so in a way that the libdb_cxx-4.8.so cannot be found.  Any help would be much appreciated.


Title: Re: Centos 6.5 and Bitcoin
Post by: CoinHeavy on April 28, 2014, 05:52:25 PM
I am using the following:
http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html (http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html)

and http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz (http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz)


Title: Re: Centos 6.5 and Bitcoin
Post by: CoinHeavy on April 28, 2014, 06:05:07 PM
I have located libdb_cxx-4.8.so in db-4.8.30.NC/build_unix/.libs

If I simply copy or reference this in the correct places, should that resolve the issue?
If I use 'locate libdb_cxx' I get entries for 'libdb_cxx.so' and 'libdb_cxx-4.7.so' in /usr/lib64, but that's all.

Should I point bitcoin/src/m4/bitcoin_find_bdb48.m4, line:7, 'bdbdirlist=/root/berkeley-db/db-4.8.30.NC/build_unix/.libs' ?

Copying libdb_cxx-4.8.so do /usr/lib64 does not seem to resolve the issue.


Title: Re: Centos 6.5 and Bitcoin
Post by: Initscri on April 29, 2014, 07:18:30 AM
Ref: http://forum.bbqcoin.org/viewtopic.php?p=1813&sid=9993bb7d8ffdc5ade9a95159626ff7f1

Have you already tried doing something along those lines.


Title: Re: Centos 6.5 and Bitcoin
Post by: m3 on May 01, 2014, 08:48:12 AM
I had the same problem as you and finally was able to figure it out. So the configuration is not recognizing the cxx files. The 2 things I did that made a difference was to modify the m4:

add the path to ./src/m4/bitcoin_find_bdb48.m4:

  bdbdirlist=/path/to/compiled/db-4.8.30.NC/build_unix/build/include

Now I know you already tried it but leave the path there and now try to install the berkeley db 4.8 from scratch using these commands:

cd build_unix                        &&
../dist/configure --prefix=/usr      \
                  --enable-compat185 \
                  --enable-dbm       \
                  --disable-static   \
                  --enable-cxx       &&
make
Now, as the root user:

make docdir=/usr/share/doc/db-4.8.30 install &&
chown -v -R root:root                        \
      /usr/bin/db_*                          \
      /usr/include/db{,_185,_cxx}.h          \
      /usr/lib/libdb*.{so,la}                \
      /usr/share/doc/db-4.8.30

The commands were taken from: http://www.linuxfromscratch.org/blfs/view/svn/server/db.html
This setup is mean for db 6.0 but it works fine for 4.8 aswell

Hope I helped! and if I did: 1CNdsvPFwm899J6c8JxrM55jPrtPVB1M2X


EDIT: It let me compile but when i run bitcoind I get an error while loading shared libraries still something to do with db4.8

EDIT2: Was able to fix the issue with bitcoind not finding some bdb 4.8 dependancy by doing this:

export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.8/lib/

EDIT3: Now I am facing a problem where once I start bitcoind I get this error:

 bitcoind: key.cpp:135: <unnamed>::CECKey::CECKey(): Assertion `pkey != __null' failed.

Any help is appreciated.


Title: Re: Centos 6.5 and Bitcoin
Post by: CoinHeavy on May 03, 2014, 11:40:47 PM
Thanks m3.

I am having the same issue.

This is due to the version of OpenSSL that ships with CentOS not supporting elliptical curve.
Compiling the right version of OpenSSL seems as simple as:

Code:
echo 'NOTICE: Downloading OpenSSL 1.0.1g...'
wget ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/openssl-1.0.1g.tar.gz
tar xzvf openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
echo 'NOTICE: Configuring OpenSSL 1.0.1g...'
./config shared --prefix=/usr/local --libdir=lib
echo 'NOTICE: Compiling OpenSSL 1.0.1g...'
make
echo 'NOTICE: Installing OpenSSL 1.0.1g…'
make install

However I can't seem to get bitcoind to recognize this (the CEC error persists).
There used to be a solution that went like this:
Code:
sed -i -e 's/$(OPENSSL_INCLUDE_PATH))/$(OPENSSL_INCLUDE_PATH) \/usr\/local\/include)/' Makefile
sed -i -e 's/$(OPENSSL_LIB_PATH))/$(OPENSSL_LIB_PATH) \/usr\/local\/lib)/' Makefile
sed -i -e 's/$(LDHARDENING) $(LDFLAGS)/$(LDHARDENING) -Wl,-rpath,\/usr\/local\/lib $(LDFLAGS)/' Makefile

Unfortunately, this was in the makefile.unix days. Now that autogen.sh and configure are being used, these sed commands don't do anything.
I'm not certain how to get the autogen/configure/make/runtime processes pointed at the right version of openSSL.  I would also be fine with just replacing the system version of openssl with the one that supports EC but I'm not sure about how to do that either.

I think we're close though.


Title: Re: Centos 6.5 and Bitcoin
Post by: mindragon on May 19, 2014, 10:04:03 PM
Anyone have any more luck installing Bitcoin latest on Centos 6.5? I'm still running 8.x series because of the inability to compile under latest Centos ... The Dependencies listed are all newer that the latest that I can seem to download and compile.


Title: Re: Centos 6.5 and Bitcoin
Post by: Abdussamad on May 23, 2014, 07:31:55 AM
Anyone have any more luck installing Bitcoin latest on Centos 6.5? I'm still running 8.x series because of the inability to compile under latest Centos ... The Dependencies listed are all newer that the latest that I can seem to download and compile.

Download the bitcoin core 0.9.1 linux binary tarball from bitcoin.org. Use the bitcoind.static executable. No need to compile anything.


Title: Re: Centos 6.5 and Bitcoin
Post by: trny on June 11, 2014, 06:17:55 AM
This is a super late response, but I ran into the exact same problem as you on Ubuntu 14.04 today so I thought I'd share. Built BerkeleyDB 4.8 from scratch which resulted in a successful compile but received the same error when trying to start the daemon.

Turns out a simple "apt-get install libdb4.8++" does the trick.



Title: Re: Centos 6.5 and Bitcoin
Post by: Ashbite on June 11, 2014, 05:22:25 PM
This is a super late response, but I ran into the exact same problem as you on Ubuntu 14.04 today so I thought I'd share. Built BerkeleyDB 4.8 from scratch which resulted in a successful compile but received the same error when trying to start the daemon.

Turns out a simple "apt-get install libdb4.8++" does the trick.



Exactly what he says, this should do the trick. Ive had this problem before.


Title: Worked for me on Centos 6.5 and Bitcoin
Post by: zguby on July 07, 2014, 11:15:47 AM
#Worked for me:
#CentOs 6.5 minimal on (VirtualBox)
#disabled selinux
yum -y groupinstall "Development Tools"
yum -y install wget
yum update -y && reboot

#CentOS/RHEL 6, 32 Bit (i686):
rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
#CentOS/RHEL 6, 32 Bit (i386):
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#CentOS/RHEL 6, 32 Bit (i386):
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#CentOS/RHEL 6:
rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm

#pulling bitcoin-master from git, python and stratum... then


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.tar.gz

cd build_unix                        &&
../dist/configure --prefix=/usr      \
                  --enable-compat185 \
                  --enable-dbm       \
                  --disable-static   \
                  --enable-cxx       &&
make
make install


yum install boost boost-devel boost-doc
yum install openssl openssl-devel

cd ~/
cd ./bitcoin-master
./autogen.sh
./configure
make

all done.


Title: Re: Centos 6.5 and Bitcoin
Post by: Xialla on June 24, 2015, 02:48:38 PM
@zguby: yeah, your manual makes sense, anyway I really can't recommend you to use rpmforge, epel and remi without yum priorities plugin.

some details about it: http://wiki.centos.org/PackageManagement/Yum/Priorities

also, why disable selinux? there is some special reason for bitcoincore client or you just did it by default?:)


Title: Re: Centos 6.5 and Bitcoin
Post by: tspacepilot on June 24, 2015, 06:08:08 PM
I'd like to know more generally what's going on with the berkleydb ( 4.8 ).  I was building an altcoin (a bitcoin clone) on debian the other day and I also had to jump through some hoops.  I guess I'm looking for an answer to either of these complementary questions:

1) why does bitcoin-core (and clones) use a db that's not in the repos of standard distros?
2) why do standard distros not have this db?


Title: Re: Centos 6.5 and Bitcoin
Post by: RedDiamond on June 25, 2015, 12:32:59 PM
You can find some info about bitcoin Berkeley DB v4.8 dependency from here: https://bitcointalk.org/index.php?topic=502482.0


Title: Re: Centos 6.5 and Bitcoin
Post by: tspacepilot on June 25, 2015, 02:38:22 PM
You can find some info about bitcoin Berkeley DB v4.8 dependency from here: https://bitcointalk.org/index.php?topic=502482.0
Thanks for the link to that thread, RedDiamond.  I just read through it and I'd say I'm basically caught up on the issues at play.  I'm hoping that they either start shipping their own C for berkely db (as gmaxwell suggested they would once distros stop carrying it at all) or move to another solution soon.  It's silly to have to add old repos in order to build an up-to-date software package.


Title: Re: Centos 6.5 and Bitcoin
Post by: Perlover on June 07, 2017, 01:26:07 PM
Hello!

I wrote and tested Makefile for local-user environment for compiling and installing Bitcoin Core UASF patch (https://github.com/UASF/bitcoin)
It's for CentOS 6.* but i hope it will work in any Linux and *BSD systems

https://github.com/Perlover/bitcoin-uasf-makefile

Please README.txt there (why i did it)

Best regards, Perlover :)