Bitcoin Forum
November 11, 2024, 08:25:00 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Centos 6.5 and Bitcoin  (Read 7268 times)
CoinHeavy (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100


View Profile
April 28, 2014, 05:49:40 PM
 #1

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.
CoinHeavy (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100


View Profile
April 28, 2014, 05:52:25 PM
 #2

I am using the following:
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
CoinHeavy (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100


View Profile
April 28, 2014, 06:05:07 PM
 #3

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.
Initscri
Hero Member
*****
Offline Offline

Activity: 1582
Merit: 759


View Profile WWW
April 29, 2014, 07:18:30 AM
 #4

Ref: http://forum.bbqcoin.org/viewtopic.php?p=1813&sid=9993bb7d8ffdc5ade9a95159626ff7f1

Have you already tried doing something along those lines.

----------------------------------
Web Developer. PM for details.
----------------------------------
m3
Sr. Member
****
Offline Offline

Activity: 460
Merit: 250


View Profile WWW
May 01, 2014, 08:48:12 AM
Last edit: May 01, 2014, 09:27:05 AM by m3
 #5

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.

CoinHeavy (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100


View Profile
May 03, 2014, 11:40:47 PM
Last edit: May 04, 2014, 06:17:52 PM by CoinHeavy
 #6

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.
mindragon
Full Member
***
Offline Offline

Activity: 173
Merit: 100


View Profile
May 19, 2014, 10:04:03 PM
 #7

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.
Abdussamad
Legendary
*
Offline Offline

Activity: 3682
Merit: 1580



View Profile
May 23, 2014, 07:31:55 AM
 #8

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.
trny
Newbie
*
Offline Offline

Activity: 48
Merit: 0


View Profile
June 11, 2014, 06:17:55 AM
 #9

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.

Ashbite
Full Member
***
Offline Offline

Activity: 168
Merit: 100


View Profile
June 11, 2014, 05:22:25 PM
 #10

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.
zguby
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 07, 2014, 11:15:47 AM
Last edit: July 07, 2014, 11:27:38 AM by zguby
 #11

#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.
Xialla
Legendary
*
Offline Offline

Activity: 1036
Merit: 1001


/dev/null


View Profile
June 24, 2015, 02:48:38 PM
 #12

@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?:)
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1081


I may write code in exchange for bitcoins.


View Profile
June 24, 2015, 06:08:08 PM
 #13

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?
RedDiamond
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250


View Profile
June 25, 2015, 12:32:59 PM
 #14

You can find some info about bitcoin Berkeley DB v4.8 dependency from here: https://bitcointalk.org/index.php?topic=502482.0
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1081


I may write code in exchange for bitcoins.


View Profile
June 25, 2015, 02:38:22 PM
 #15

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.
Perlover
Full Member
***
Offline Offline

Activity: 162
Merit: 109


View Profile
June 07, 2017, 01:26:07 PM
 #16

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 Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!