Author

Topic: [Paid] [Bounty: 10 BTC] Bitcoind build instructions for Centos x86 and x64 (Read 15637 times)

full member
Activity: 221
Merit: 100
I'm trying to compile the current version of bitcoin on Centos and I'm having some issues as well.  Does anyone have a good process for compiling bitcoin 0.9.1 on Centos 6.5 (x64)?  Thanks in advance.
member
Activity: 106
Merit: 10
I think we need an update again.  Having a heck of a time trying to build on centos.  The github script works partly.. it builds the toolchain.. mostly.  I got that working.  But configure in bitcoind bombs out on the boost configure.
newbie
Activity: 23
Merit: 0

I finally got CentOS 6.4 to rebuiild openssl with elliptic curves enabled, as required for Bitcoin.

The primary issue is that the CentOS openssl source package contains tarball openssl-1.0.0-usa.tar.bz2

The correct replacement tarball package from openssl.org would be this one http://www.openssl.org/source/openssl-1.0.0.tar.gz

Secondly, a patch from openssl.org is also needed: http://cvs.openssl.org/patchset?cn=19998

After the above two downloads, the spec file is edited to enable EC, point to the new source, and update the release number.

Detailed instructions on to do the build are here: https://bitcointalksearch.org/topic/m.2624466
newbie
Activity: 23
Merit: 0
Weex & KJJ,

Please see my newbie dissertation https://bitcointalksearch.org/topic/bitcoind-centos-clean-compile-on-aws-ec2-239337

A good solution might be to define a procedure to generate an SRPM (source-RPM) package from the GIT source.
legendary
Activity: 1102
Merit: 1014
This is the latest build I have 0.6. It will show a warning that it needs to update but if it helps you here it is.

http://owneo.com/bitcoind-60003-64bit-centos5

The build process hasn't worked for me since that version.

13DQrtowGDnZUie2j9WvsKuocR8cE2XJF1


I tried your version, it works so far without error but its not loading the chain ... :/

Could fix the problem with your version. CSF was blocking it Smiley

sending 4 BTC to you and another 4 BTC will go into the pool for a working build instruction of the "up to date" client.

Transaktion: 592a8aa608ba72900e1cd8838d69276b7920f8a4be1f6af43979ebd942a31a81

Thank you and I'm glad to hear it's working for you with that tweak. Updating the other thread now.
legendary
Activity: 906
Merit: 1002
This is the latest build I have 0.6. It will show a warning that it needs to update but if it helps you here it is.

http://owneo.com/bitcoind-60003-64bit-centos5

The build process hasn't worked for me since that version.

13DQrtowGDnZUie2j9WvsKuocR8cE2XJF1


I tried your version, it works so far without error but its not loading the chain ... :/

Could fix the problem with your version. CSF was blocking it Smiley

sending 4 BTC to you and another 4 BTC will go into the pool for a working build instruction of the "up to date" client.

Transaktion: 592a8aa608ba72900e1cd8838d69276b7920f8a4be1f6af43979ebd942a31a81
hero member
Activity: 489
Merit: 500
I was speaking in regards to the binary weex posted above. I looked in /var/log/messages and this is what I saw:

Code:
Aug  5 20:09:36 frost kernel: bitcoind[18680]: segfault at 0 ip 00000000007c0b90 sp 00007fff3a5e6688 error 6 in bitcoind[400000+590000]
Aug  5 20:09:36 frost abrt[18681]: Saved core dump of pid 18680 (/home/user/bitcoind) to /var/spool/abrt/ccpp-2012-08-05-20:09:36-18680 (172032 bytes)
Aug  5 20:09:36 frost abrtd: Directory 'ccpp-2012-08-05-20:09:36-18680' creation detected
Aug  5 20:09:36 frost abrtd: Executable '/home/user/bitcoind' doesn't belong to any package
Aug  5 20:09:36 frost abrtd: 'post-create' on '/var/spool/abrt/ccpp-2012-08-05-20:09:36-18680' exited with 1
Aug  5 20:09:36 frost abrtd: Corrupted or bad directory /var/spool/abrt/ccpp-2012-08-05-20:09:36-18680, deleting

legendary
Activity: 906
Merit: 1002
Interesting. That is the first time I have ever encountered an openssl without built-in sha256 support...

Anyway, you can open contrib/vagrant/Makefile and do a find-replace, changing 'openssl sha256' into 'sha256sum -b'. That *should* work. I'm not near my development machine or else I would update the pull-request and test it myself.

now this error pops out ...

Code:
make check-requirements
[check requirements]

Missing requirement: vagrant

Please have a look at "README" to ensure
that your system meets all requirements.

make: *** [.stamp-check-requirements.h] Error 1

but rpm says its installed ...

Code:
rpm -ivh vagrant_1.0.3_x86_64.rpm
Preparing...                ########################################### [100%]
        package vagrant-1.0.3-1.x86_64 is already installed

fixed it myself, added /opt/vagrant/bin to the PATH variable

now it says

Code:
make check-requirements
[check requirements]
/opt/vagrant/bin/../embedded/bin/ruby: /lib64/libc.so.6: version `GLIBC_2.6' not found (required by /opt/vagrant/embedded/bin/../lib/libruby.so.1.9)

Wrong version of requirement: vagrant

It looks like I only have GLIBC_2.5 ... and yum wont update it, as its "up to date"....
legendary
Activity: 1102
Merit: 1014
FYI, this bounty has been paid so I created the new bounty here. It's up to 4 BTC!
legendary
Activity: 905
Merit: 1014
Interesting. That is the first time I have ever encountered an openssl without built-in sha256 support...

Anyway, you can open contrib/vagrant/Makefile and do a find-replace, changing 'openssl sha256' into 'sha256sum -b'. That *should* work. I'm not near my development machine or else I would update the pull-request and test it myself.
legendary
Activity: 906
Merit: 1002
vagrant is now installed but this only leads to the next problem... my openssl dont seem to know what sha256 is but under /usr/bin/sha256 I can find a sha256hmac and sha256sum...

Code:
make check-requirements
openssl:Error: 'sha256' is an invalid command.

Standard commands
asn1parse      ca             ciphers        crl            crl2pkcs7      
dgst           dh             dhparam        dsa            dsaparam      
enc            engine         errstr         gendh          gendsa        
genrsa         nseq           ocsp           passwd         pkcs12        
pkcs7          pkcs8          prime          rand           req            
rsa            rsautl         s_client       s_server       s_time        
sess_id        smime          speed          spkac          verify        
version        x509          

Message Digest commands (see the `dgst' command for more details)
md2            md4            md5            rmd160         sha            
sha1          

Cipher commands (see the `enc' command for more details)
aes-128-cbc    aes-128-ecb    aes-192-cbc    aes-192-ecb    aes-256-cbc    
aes-256-ecb    base64         bf             bf-cbc         bf-cfb        
bf-ecb         bf-ofb         cast           cast-cbc       cast5-cbc      
cast5-cfb      cast5-ecb      cast5-ofb      des            des-cbc        
des-cfb        des-ecb        des-ede        des-ede-cbc    des-ede-cfb    
des-ede-ofb    des-ede3       des-ede3-cbc   des-ede3-cfb   des-ede3-ofb  
des-ofb        des3           desx           rc2            rc2-40-cbc    
rc2-64-cbc     rc2-cbc        rc2-cfb        rc2-ecb        rc2-ofb        
rc4            rc4-40        

openssl:Error: 'sha256' is an invalid command.

Standard commands
asn1parse      ca             ciphers        crl            crl2pkcs7      
dgst           dh             dhparam        dsa            dsaparam      
enc            engine         errstr         gendh          gendsa        
genrsa         nseq           ocsp           passwd         pkcs12        
pkcs7          pkcs8          prime          rand           req            
rsa            rsautl         s_client       s_server       s_time        
sess_id        smime          speed          spkac          verify        
version        x509          

Message Digest commands (see the `dgst' command for more details)
md2            md4            md5            rmd160         sha            
sha1          

Cipher commands (see the `enc' command for more details)
aes-128-cbc    aes-128-ecb    aes-192-cbc    aes-192-ecb    aes-256-cbc    
aes-256-ecb    base64         bf             bf-cbc         bf-cfb        
bf-ecb         bf-ofb         cast           cast-cbc       cast5-cbc      
cast5-cfb      cast5-ecb      cast5-ofb      des            des-cbc        
des-cfb        des-ecb        des-ede        des-ede-cbc    des-ede-cfb    
des-ede-ofb    des-ede3       des-ede3-cbc   des-ede3-cfb   des-ede3-ofb  
des-ofb        des3           desx           rc2            rc2-40-cbc    
rc2-64-cbc     rc2-cbc        rc2-cfb        rc2-ecb        rc2-ofb        
rc4            rc4-40        

openssl:Error: 'sha256' is an invalid command.

Standard commands
asn1parse      ca             ciphers        crl            crl2pkcs7      
dgst           dh             dhparam        dsa            dsaparam      
enc            engine         errstr         gendh          gendsa        
genrsa         nseq           ocsp           passwd         pkcs12        
pkcs7          pkcs8          prime          rand           req            
rsa            rsautl         s_client       s_server       s_time        
sess_id        smime          speed          spkac          verify        
version        x509          

Message Digest commands (see the `dgst' command for more details)
md2            md4            md5            rmd160         sha            
sha1          

Cipher commands (see the `enc' command for more details)
aes-128-cbc    aes-128-ecb    aes-192-cbc    aes-192-ecb    aes-256-cbc    
aes-256-ecb    base64         bf             bf-cbc         bf-cfb        
bf-ecb         bf-ofb         cast           cast-cbc       cast5-cbc      
cast5-cfb      cast5-ecb      cast5-ofb      des            des-cbc        
des-cfb        des-ecb        des-ede        des-ede-cbc    des-ede-cfb    
des-ede-ofb    des-ede3       des-ede3-cbc   des-ede3-cfb   des-ede3-ofb  
des-ofb        des3           desx           rc2            rc2-40-cbc    
rc2-64-cbc     rc2-cbc        rc2-cfb        rc2-ecb        rc2-ofb        
rc4            rc4-40        

[check requirements]

Missing requirement: vagrant

Please have a look at "README" to ensure
that your system meets all requirements.

make: *** [.stamp-check-requirements.h] Error 1

@bytedisorder, you should be more specific which binary do you mean? I only test this on CentOS 5.6
hero member
Activity: 489
Merit: 500
You guys ran this binary on centOS 6? Because I keep getting a segmentation fault...
legendary
Activity: 905
Merit: 1014
Wonderful. Looks like a ruby bug.

But thankfully that shouldn't concern you as there is an alternative: download the binary RPM from here:

http://downloads.vagrantup.com/tags/v1.0.3

and install:

Quote
rpm -i vagrant_1.0.3_x86_64.rpm
legendary
Activity: 906
Merit: 1002
Code:
gem install -V vagrant
GET 302 Found: http://gems.rubyforge.org/latest_specs.4.8.gz
GET 304 Not Modified: http://production.s3.rubygems.org/latest_specs.4.8.gz
GET 302 Found: http://gems.rubyforge.org/specs.4.8.gz
GET 304 Not Modified: http://production.s3.rubygems.org/specs.4.8.gz
Installing gem childprocess-0.3.4
*** buffer overflow detected ***: /usr/bin/ruby terminated
======= Backtrace: =========
/lib64/libc.so.6(__chk_fail+0x2f)[0x3dff2e807f]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(rb_syck_mktime+0x48e)[0x2b583925098e]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(yaml_org_handler+0x860)[0x2b58392512a0]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syck_defaultresolver_node_import+0x39)[0x2b58392514a9]
/usr/lib64/libruby.so.1.8[0x2b5838a60a9e]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a61562]
/usr/lib64/libruby.so.1.8(rb_funcall+0x85)[0x2b5838a61835]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(rb_syck_load_handler+0x47)[0x2b5839250437]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syck_hdlr_add_node+0x39)[0x2b583924b839]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syckparse+0xb45)[0x2b583924c605]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syck_parse+0x19)[0x2b5839254d29]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syck_parser_load+0xed)[0x2b58392502ad]
/usr/lib64/libruby.so.1.8[0x2b5838a60a9e]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67d36]
/usr/lib64/libruby.so.1.8[0x2b5838a67125]
/usr/lib64/libruby.so.1.8[0x2b5838a60aba]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67d36]
/usr/lib64/libruby.so.1.8[0x2b5838a67125]
/usr/lib64/libruby.so.1.8[0x2b5838a60aba]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67d36]
/usr/lib64/libruby.so.1.8[0x2b5838a69804]
/usr/lib64/libruby.so.1.8[0x2b5838a60aba]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67e69]
/usr/lib64/libruby.so.1.8[0x2b5838a67009]
/usr/lib64/libruby.so.1.8[0x2b5838a69cb5]
/usr/lib64/libruby.so.1.8[0x2b5838a6bcbf]
/usr/lib64/libruby.so.1.8[0x2b5838a68307]
/usr/lib64/libruby.so.1.8[0x2b5838a6bcbf]
/usr/lib64/libruby.so.1.8[0x2b5838a6d1c9]
/usr/lib64/libruby.so.1.8[0x2b5838a60a9e]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67e69]
/usr/lib64/libruby.so.1.8[0x2b5838a6a10d]
/usr/lib64/libruby.so.1.8[0x2b5838a60aba]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67d36]
/usr/lib64/libruby.so.1.8[0x2b5838a6a10d]
/usr/lib64/libruby.so.1.8[0x2b5838a60aba]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8(rb_obj_call_init+0x54)[0x2b5838a61274]
/usr/lib64/libruby.so.1.8(rb_class_new_instance+0x32)[0x2b5838a8b782]
/usr/lib64/libruby.so.1.8[0x2b5838a60a9e]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8(rb_call_super+0x8d)[0x2b5838a6201d]
/usr/lib64/libruby.so.1.8[0x2b5838a60329]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67e69]
/usr/lib64/libruby.so.1.8[0x2b5838a67125]
/usr/lib64/libruby.so.1.8[0x2b5838a69cb5]
/usr/lib64/libruby.so.1.8[0x2b5838a60aba]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67d36]
/usr/lib64/libruby.so.1.8[0x2b5838a6a96f]
/usr/lib64/libruby.so.1.8[0x2b5838a680e5]
/usr/lib64/libruby.so.1.8[0x2b5838a60aba]
/usr/lib64/libruby.so.1.8[0x2b5838a60fb8]
/usr/lib64/libruby.so.1.8[0x2b5838a67d36]
/usr/lib64/libruby.so.1.8[0x2b5838a6a10d]
======= Memory map: ========
00400000-00401000 r-xp 00000000 fd:00 33572585                           /usr/bin/ruby
00600000-00601000 rw-p 00000000 fd:00 33572585                           /usr/bin/ruby
1939a000-1e345000 rw-p 1939a000 00:00 0                                  [heap]
4180d000-4180e000 ---p 4180d000 00:00 0
4180e000-4220e000 rw-p 4180e000 00:00 0
3dfee00000-3dfee1c000 r-xp 00000000 fd:00 12582937                       /lib64/ld-2.5.so
3dff01c000-3dff01d000 r--p 0001c000 fd:00 12582937                       /lib64/ld-2.5.so
3dff01d000-3dff01e000 rw-p 0001d000 fd:00 12582937                       /lib64/ld-2.5.so
3dff200000-3dff34e000 r-xp 00000000 fd:00 12582988                       /lib64/libc-2.5.so
3dff34e000-3dff54e000 ---p 0014e000 fd:00 12582988                       /lib64/libc-2.5.so
3dff54e000-3dff552000 r--p 0014e000 fd:00 12582988                       /lib64/libc-2.5.so
3dff552000-3dff553000 rw-p 00152000 fd:00 12582988                       /lib64/libc-2.5.so
3dff553000-3dff558000 rw-p 3dff553000 00:00 0
3dff600000-3dff602000 r-xp 00000000 fd:00 12582990                       /lib64/libdl-2.5.so
3dff602000-3dff802000 ---p 00002000 fd:00 12582990                       /lib64/libdl-2.5.so
3dff802000-3dff803000 r--p 00002000 fd:00 12582990                       /lib64/libdl-2.5.so
3dff803000-3dff804000 rw-p 00003000 fd:00 12582990                       /lib64/libdl-2.5.so
3dffa00000-3dffa82000 r-xp 00000000 fd:00 12583084                       /lib64/libm-2.5.so
3dffa82000-3dffc81000 ---p 00082000 fd:00 12583084                       /lib64/libm-2.5.so
3dffc81000-3dffc82000 r--p 00081000 fd:00 12583084                       /lib64/libm-2.5.so
3dffc82000-3dffc83000 rw-p 00082000 fd:00 12583084                       /lib64/libm-2.5.so
3dffe00000-3dffe16000 r-xp 00000000 fd:00 12583266                       /lib64/libpthread-2.5.so
3dffe16000-3e00015000 ---p 00016000 fd:00 12583266                       /lib64/libpthread-2.5.so
3e00015000-3e00016000 r--p 00015000 fd:00 12583266                       /lib64/libpthread-2.5.so
3e00016000-3e00017000 rw-p 00016000 fd:00 12583266                       /lib64/libpthread-2.5.so
3e00017000-3e0001b000 rw-p 3e00017000 00:00 0
3e00200000-3e00214000 r-xp 00000000 fd:00 12583267                       /lib64/libz.so.1.2.3
3e00214000-3e00413000 ---p 00014000 fd:00 12583267                       /lib64/libz.so.1.2.3
3e00413000-3e00414000 rw-p 00013000 fd:00 12583267                       /lib64/libz.so.1.2.3
3e00600000-3e0063b000 r-xp 00000000 fd:00 12583269                       /lib64/libsepol.so.1
3e0063b000-3e0083b000 ---p 0003b000 fd:00 12583269                       /lib64/libsepol.so.1
3e0083b000-3e0083c000 rw-p 0003b000 fd:00 12583269                       /lib64/libsepol.so.1
3e0083c000-3e00846000 rw-p 3e0083c000 00:00 0
3e00a00000-3e00a15000 r-xp 00000000 fd:00 12583270                       /lib64/libselinux.so.1
3e00a15000-3e00c15000 ---p 00015000 fd:00 12583270                       /lib64/libselinux.so.1
3e00c15000-3e00c17000 rw-p 00015000 fd:00 12583270                       /lib64/libselinux.so.1
3e00c17000-3e00c18000 rw-p 3e00c17000 00:00 0
3e01600000-3e01609000 r-xp 00000000 fd:00 12583238                       /lib64/libcrypt-2.5.so
3e01609000-3e01808000 ---p 00009000 fd:00 12583238                       /lib64/libcrypt-2.5.so
3e01808000-3e01809000 r--p 00008000 fd:00 12583238                       /lib64/libcrypt-2.5.so
3e01809000-3e0180a000 rw-p 00009000 fd:00 12583238                       /lib64/libcrypt-2.5.so
3e0180a000-3e01838000 rw-p 3e0180a000 00:00 0
3e01e00000-3e01f2d000 r-xp 00000000 fd:00 12583278                       /lib64/libcrypto.so.0.9.8e
3e01f2d000-3e0212c000 ---p 0012d000 fd:00 12583278                       /lib64/libcrypto.so.0.9.8e
3e0212c000-3e0214d000 rw-p 0012c000 fd:00 12583278                       /lib64/libcrypto.so.0.9.8e
3e0214d000-3e02151000 rw-p 3e0214d000 00:00 0
3e02200000-3e0222c000 r-xp 00000000 fd:00 33570745                       /usr/lib64/libgssapi_krb5.so.2.2
3e0222c000-3e0242c000 ---p 0002c000 fd:00 33570745                       /usr/lib64/libgssapi_krb5.so.2.2
3e0242c000-3e0242e000 rw-p 0002c000 fd:00 33570745                       /usr/lib64/libgssapi_krb5.so.2.2
3e03a00000-3e03a02000 r-xp 00000000 fd:00 12582982                       /lib64/libkeyutils-1.2.so
3e03a02000-3e03c01000 ---p 00002000 fd:00 12582982                       /lib64/libkeyutils-1.2.so
3e03c01000-3e03c02000 rw-p 00001000 fd:00 12582982                       /lib64/libkeyutils-1.2.so
3e03e00000-3e03e11000 r-xp 00000000 fd:00 12583236                       /lib64/libresolv-2.5.so
3e03e11000-3e04011000 ---p 00011000 fd:00 12583236                       /lib64/libresolv-2.5.so
3e04011000-3e04012000 r--p 00011000 fd:00 12583236                       /lib64/libresolv-2.5.so
3e04012000-3e04013000 rw-p 00012000 fd:00 12583236                       /lib64/libresolv-2.5.so
3e04013000-3e04015000 rw-p 3e04013000 00:00 0
3e04200000-3e04202000 r-xp 00000000 fd:00 12583277                       /lib64/libcom_err.so.2.1
3e04202000-3e04401000 ---p 00002000 fd:00 12583277                       /lib64/libcom_err.so.2.1
3e04401000-3e04402000 rw-p 00001000 fd:00 12583277                       /lib64/libcom_err.so.2.1
3e04e00000-3e04e92000 r-xp 00000000 fd:00 33570744                       /usr/lib64/libkrb5.so.3.3
3e04e92000-3e05091000 ---p 00092000 fd:00 33570744                       /usr/lib64/libkrb5.so.3.3
3e05091000-3e05095000 rw-p 00091000 fd:00 33570744                       /usr/lib64/libkrb5.so.3.3
3e05200000-3e05224000 r-xp 00000000 fd:00 33570743                       /usr/lib64/libk5crypto.so.3.1
3e05224000-3e05423000 ---p 00024000 fd:00 33570743                       /usr/lib64/libk5crypto.so.3.1
3e05423000-3e05425000 rw-p 00023000 fd:00 33570743                       /usr/lib64/libk5crypto.so.3.1
3e05600000-3e05608000 r-xp 00000000 fd:00 33570742                       /usr/lib64/libkrb5support.so.0.1
3e05608000-3e05807000 ---p 00008000 fd:00 33570742                       /usr/lib64/libkrb5support.so.0.1
3e05807000-3e05808000 rw-p 00007000 fd:00 33570742                       /usr/lib64/libkrb5support.so.0.1
3e06600000-3e06646000 r-xp 00000000 fd:00 12583279                       /lib64/libssl.so.0.9.8e
3e06646000-3e06846000 ---p 00046000 fd:00 12583279                       /lib64/libssl.so.0.9.8e
3e06846000-3e0684c000 rw-p 00046000 fd:00 12583279                       /lib64/libssl.so.0.9.8e
2aaaaaadb000-2aaaaaade000 rw-p 2aaaaaadb000 00:00 0
2aaaaac21000-2aaaab0cb000 rw-p 2aaaaac21000 00:00 0
2aaaab0cb000-2aaaab0fe000 rw-p 2aaaaaaab000 00:00 0
2aaaab0fe000-2aaaabdf9000 rw-p 2aaaab0fe000 00:00 0
2aaaabe07000-2aaaabe14000 r-xp 00000000 fd:00 12582914                   /lib64/libgcc_s-4.1.2-20080825.so.1
2aaaabe14000-2aaaac014000 ---p 0000d000 fd:00 12582914                   /lib64/libgcc_s-4.1.2-20080825.so.1
2aaaac014000-2aaaac015000 rw-p 0000d000 fd:00 12582914                   /lib64/libgcc_s-4.1.2-20080825.so.1
2b5838a1c000-2b5838a1e000 rw-p 2b5838a1c000 00:00 0
2b5838a2c000-2b5838b05000 r-xp 00000000 fd:00 33572583                   /usr/lib64/libruby.so.1.8.5
2b5838b05000-2b5838d04000 ---p 000d9000 fd:00 33572583                   /usr/lib64/libruby.so.1.8.5
2b5838d04000-2b5838d09000 rw-p 000d8000 fd:00 33572583                   /usr/lib64/libruby.so.1.8.5
2b5838d09000-2b5838e3c000 rw-p 2b5838d09000 00:00 0
2b5838e3c000-2b5838e3e000 r-xp 00000000 fd:00 33988620                   /usr/lib64/ruby/1.8/x86_64-linux/etc.so
2b5838e3e000-2b583903e000 ---p 00002000 fd:00 33988620                   /usr/lib64/ruby/1.8/x86_64-linux/etc.so
2b583903e000-2b583903f000 rw-p 00002000 fd:00 33988620                   /usr/lib64/ruby/1.8/x86_64-linux/etc.so
2b583903f000-2b5839043000 r-xp 00000000 fd:00 33988633                   /usr/lib64/ruby/1.8/x86_64-linux/stringio.so
2b5839043000-2b5839243000 ---p 00004000 fd:00 33988633                   /usr/lib64/ruby/1.8/x86_64-linux/stringio.so
2b5839243000-2b5839244000 rw-p 00004000 fd:00 33988633                   /usr/lib64/ruby/1.8/x86_64-linux/stringio.so
2b5839244000-2b5839260000 r-xp 00000000 fd:00 33988635                   /usr/lib64/ruby/1.8/x86_64-linux/syck.so
2b5839260000-2b583945f000 ---p 0001c000 fd:00 33988635                   /usr/lib64/ruby/1.8/x86_64-linux/syck.so
2b583945f000-2b5839461000 rw-p 0001b000 fd:00 33988635                   /usr/lib64/ruby/1.8/x86_64-linux/syck.so
2b5839462000-2b583959f000 rw-p 2b5839462000 00:00 0
2b58395ad000-2b58395b7000 r-xp 00000000 fd:00 12582938                   /lib64/libnss_files-2.5.so
2b58395b7000-2b58397b6000 ---p 0000a000 fd:00 12582938                   /lib64/libnss_files-2.5.so
2b58397b6000-2b58397b7000 r--p 00009000 fd:00 12582938                   /lib64/libnss_files-2.5.so
2b58397b7000-2b58397b8000 rw-p 0000a000 fd:00 12582938                   /lib64/libnss_files-2.5.so
2b58397b8000-2b58397f2000 r-xp 00000000 fd:00 33988626                   /usr/lib64/ruby/1.8/x86_64-linux/openssl.so
2b58397f2000-2b58399f1000 ---p 0003a000 fd:00 33988626                   /usr/lib64/ruby/1.8/x86_64-linux/openssl.so
2b58399f1000-2b58399f4000 rw-p 00039000 fd:00 33988626                   /usr/lib64/ruby/1.8/x86_64-linux/openssl.so
2b58399f5000-2b5839c2f000 rw-p 2b58399f5000 00:00 0
2b5839c2f000-2b5839c30000 r-xp 00000000 fd:00 33988621                   /usr/lib64/ruby/1.8/x86_64-linux/fcntl.so
2b5839c30000-2b5839e2f000 ---p 00001000 fd:00 33988621                   /usr/lib64/ruby/1.8/x86_64-linux/fcntl.so
2b5839e2f000-2b5839e30000 rw-p 00000000 fd:00 33988621                   /usr/lib64/ruby/1.8/x86_64-linux/fcntl.so
2b5839e30000-2b5839e39000 r-xp 00000000 fd:00 33988637                   /usr/lib64/ruby/1.8/x86_64-linux/zlib.so
2b5839e39000-2b583a038000 ---p 00009000 fd:00 33988637                   /usr/lib64/ruby/1.8/x86_64-linux/zlib.so
2b583a038000-2b583a039000 rw-p 00008000 fd:00 33988637                   /usr/lib64/ruby/1.8/x86_64-linux/zlib.so
2b583a039000-2b583a03b000 r-xp 00000000 fd:00 33988614                   /usr/lib64/ruby/1.8/x86_64-linux/digest/md5.so
2b583a03b000-2b583a23a000 ---p 00002000 fd:00 33988614              Aborted
legendary
Activity: 905
Merit: 1014
Wicked. Can you post the results of:

Quote
# gem install -V vagrant
legendary
Activity: 906
Merit: 1002
Would love to test it but i get this:
Code:
sudo gem install vagrant
*** buffer overflow detected ***: /usr/bin/ruby terminated
legendary
Activity: 905
Merit: 1014
Install VirtualBox. Then:

Quote
sudo yum install rubygems
sudo gem install vagrant
git clone git://github.com/bitcoin/bitcoin
cd bitcoin
git checkout v0.6.3
curl -L https://github.com/bitcoin/bitcoin/pull/1597.patch | patch -p1
cd contrib/vagrant
make check-requirements

Download and install any requirements it complains about:

Quote
sudo yum install ...

Build:

Quote
make download
time make all

It'll take a while the first time, after than builds will be considerably faster. You'll find the zipped binaries in the 'output' directory.


can I has bounty too?

17SRxATG3LZrD7WWTCr5EfCapprShVEtP
legendary
Activity: 906
Merit: 1002
This is the latest build I have 0.6. It will show a warning that it needs to update but if it helps you here it is.

http://owneo.com/bitcoind-60003-64bit-centos5

The build process hasn't worked for me since that version.

13DQrtowGDnZUie2j9WvsKuocR8cE2XJF1


I tried your version, it works so far without error but its not loading the chain ... :/
legendary
Activity: 1102
Merit: 1014
Yeah, ubuntu or debian are both much easier to support. Still, it's really hard to ignore the vast number of Redhat/Centos boxes out there that need to be supported.

I'll host another bounty with a repeat of this thread if someone would like to fund it initially.
hero member
Activity: 489
Merit: 500
That does not run unfortunately it still throws a segmentation fault and dumps the core Sad maybe I'm missing some dependency. I think its time to move me server over to ubuntu.

Code:
user@localhost:./bitcoind
Segmentation fault (core dumped)
legendary
Activity: 1102
Merit: 1014
This is the latest build I have 0.6. It will show a warning that it needs to update but if it helps you here it is.

http://owneo.com/bitcoind-60003-64bit-centos5

The build process hasn't worked for me since that version.

13DQrtowGDnZUie2j9WvsKuocR8cE2XJF1
hero member
Activity: 489
Merit: 500
legendary
Activity: 1102
Merit: 1014
hero member
Activity: 489
Merit: 500
Code:
/home/bytedisorder/Bitcoin/Deps/lib/libcrypto.a -lgcc -Wl,-Bstatic -l z -l dl -l pthread
/home/bytedisorder/Bitcoin/Deps/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x21): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
obj/netbase.o: In function `LookupIntern':
/home/bytedisorder/bitcoin-master/src/netbase.cpp:90: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
obj/bitcoinrpc.o: In function `__static_initialization_and_destruction_0':

This seems to be the cause of the error, but this is a bit beyond me. I believe i have all of the needed libraries installed.
hero member
Activity: 489
Merit: 500
Does anybody have a working binary for CentOS, I have been trying to compile this makefile for about 2 days with a plethora of errors and one that seems to keep occurring:
Code:
collect2: ld returned 1 exit status
make: *** [bitcoind] Error 1

I'll send 1BTC to somebody for a working makefile or binary.

Thanks guys.
full member
Activity: 182
Merit: 100
Trying to compile it on a Centos 5.5 x64, got countless errors related to python, not sure why, I have python 2.4.3 installed:



The script kept going and it seemed fine until it finished like this:

Code:
bitcoin-bitcoin-6e3a1a3/src/test/wallet_tests.cpp
bitcoin-bitcoin-6e3a1a3/src/ui_interface.h
bitcoin-bitcoin-6e3a1a3/src/uint256.h
bitcoin-bitcoin-6e3a1a3/src/util.cpp
bitcoin-bitcoin-6e3a1a3/src/util.h
bitcoin-bitcoin-6e3a1a3/src/version.cpp
bitcoin-bitcoin-6e3a1a3/src/version.h
bitcoin-bitcoin-6e3a1a3/src/wallet.cpp
bitcoin-bitcoin-6e3a1a3/src/wallet.h
bitcoin-bitcoin-6e3a1a3/src/walletdb.cpp
bitcoin-bitcoin-6e3a1a3/src/walletdb.h
cat: /home/root/makefile.new: No such file or directory
make: *** No rule to make target `bitcoind'.  Stop.
cp: cannot stat `bitcoind': No such file or directory
kjj
legendary
Activity: 1302
Merit: 1026
Everything looks fine right up until actually trying to build bitcoind.

Code:
bitcoinrpc.cpp: In function âvoid RPCAcceptHandler(boost::shared_ptr >, boost::asio::ssl::context&, bool, AcceptedConnection*, const boost::system::error_code&)â:
bitcoinrpc.cpp:2771: error: reference to âerrorâ is ambiguous
util.h:135: error: candidates are: bool error(const char*, ...)
/home/kjj2/Bitcoin/Deps/include/boost/asio/error.hpp:57: error:                 namespace boost::asio::error { }
make: *** [obj/bitcoinrpc.o] Error 1

To be honest, I have no idea here.  I can't tell if this is because it is expecting a different version of boost, or if there was some syntax change in c++ between the version of gcc-g++ that ships with CentOS and the version that the devs use.  Since the docs say any version of boost after 1.37 is fine, but make no mention of the c++ version (at least not that I've noticed), I'm thinking it is probably the second one.

I'll grab a copy of bitcoin-master (0.6.99) and attempt to compile on a different box, and the beta 1.50 boost release.  Maybe one of those will give me a clue of some sort.
sr. member
Activity: 298
Merit: 252
Well thanks for the help, I ended up just moving us to ubuntu 11 because centos was 2 days running trying to compile with no luck.  With each version of this thing they make it harder and harder to compile in centos. Plus it gets more bloated each time. Before 3 clients used 375MB of ram, now those same 3 use 580MB of ram, this thing is a pig now!

The only problem in Ubuntu is the Boost bug that still is not fixed since version 9.04 Smiley ha ha. But I just added LC_ALL=C to our locale file and it work's fine, since this is the only thing the server's are used for.

Thanks though.
kjj
legendary
Activity: 1302
Merit: 1026
Sorry guys, I was very busy today and didn't have time to look at this.  Actually, I still am, but for different reasons.  I'll check this out as soon as I can, but that might end up being tomorrow morning instead of tonight.
legendary
Activity: 1102
Merit: 1014
Anyone have any info on this now?  We're trying to get 0.6.3 to compile in CentOS 5 and it's just not working at all, been working on it now for 2 days.
What kind of error message do you get? Where does the compile fail? Haven't tried compiling it myself...
sr. member
Activity: 298
Merit: 252
Anyone have any info on this now?  We're trying to get 0.6.3 to compile in CentOS 5 and it's just not working at all, been working on it now for 2 days.
newbie
Activity: 26
Merit: 0
Nope, guess I didn't make it clear in my EDIT:, I got it built after installing the *-static packages. Which I probably could've avoided by just doing the ldconfig thing you mentioned. Thanks for the cool script. Smiley

Now if only someone would make a .rpm and keep it up to date... Wink
kjj
legendary
Activity: 1302
Merit: 1026
Are you guys still having problems?
kjj
legendary
Activity: 1302
Merit: 1026
First, make sure you are not trying to do this as root.  There are several places where absolute paths must be specified without tilde expansion, so the path must be under /home/.  You can set the ownership of the binary to root and install it in a system path after it is built, but the build process only works as a different user.

Second, if you've recently installed zlib and/or zlib-devel, make sure you run ldconfig as root to update the library cache and symlinks.
newbie
Activity: 26
Merit: 0
I tried that script and I get this error:

Quote
g++ -pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat-security -g -DNOPCH -I/root/Bitcoin/Libraries/bitcoin-master/src -DUSE_SSL -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -I"/home/root/Bitcoin/Deps/include" -static -o bitcoind obj/checkpoints.o obj/netbase.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/irc.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/script.o obj/util.o obj/wallet.o   -Wl,-Bstatic -mtl /home/root/Bitcoin/Deps/lib/libboost_system.a -mtl /home/root/Bitcoin/Deps/lib/libboost_filesystem.a -mtl /home/root/Bitcoin/Deps/lib/libboost_program_options.a -mtl /home/root/Bitcoin/Deps/lib/libboost_thread.a /home/root/Bitcoin/Deps/lib/libdb_cxx.a -mtl /home/root/Bitcoin/Deps/lib/libssl.a -mtl /home/root/Bitcoin/Deps/lib/libcrypto.a -lgcc -Wl,-Bstatic -l z -l dl -l pthread
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [bitcoind] Error 1

What is this z library, why isn't it installed, and where can I get it?

It is a very common compression library.  You should be able to install it with:

Code:
yum install zlib

I get the same error, I have both zlib and zlib-devel installed.

EDIT: Installing zlib-static solved that error. I then got a second error for -ldl and installing glibc-static solved that issue too. Now that I look at the output from TT I notice that the build failed in a completely different place, mine failed at the very end when it's using the new makfile on bitcoind. So his problem is probably just not having zlib/zlib-devel installed.

Also, I think my problem may have been because I didn't remove the Bitcoin/ directory after some failed builds earlier from missing dependencies.
kjj
legendary
Activity: 1302
Merit: 1026
I tried that script and I get this error:

Quote
g++ -pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat-security -g -DNOPCH -I/root/Bitcoin/Libraries/bitcoin-master/src -DUSE_SSL -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -I"/home/root/Bitcoin/Deps/include" -static -o bitcoind obj/checkpoints.o obj/netbase.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/irc.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/script.o obj/util.o obj/wallet.o   -Wl,-Bstatic -mtl /home/root/Bitcoin/Deps/lib/libboost_system.a -mtl /home/root/Bitcoin/Deps/lib/libboost_filesystem.a -mtl /home/root/Bitcoin/Deps/lib/libboost_program_options.a -mtl /home/root/Bitcoin/Deps/lib/libboost_thread.a /home/root/Bitcoin/Deps/lib/libdb_cxx.a -mtl /home/root/Bitcoin/Deps/lib/libssl.a -mtl /home/root/Bitcoin/Deps/lib/libcrypto.a -lgcc -Wl,-Bstatic -l z -l dl -l pthread
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [bitcoind] Error 1

What is this z library, why isn't it installed, and where can I get it?

It is a very common compression library.  You should be able to install it with:

Code:
yum install zlib
TT
member
Activity: 77
Merit: 10
I tried that script and I get this error:

Quote
g++ -pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat-security -g -DNOPCH -I/root/Bitcoin/Libraries/bitcoin-master/src -DUSE_SSL -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -I"/home/root/Bitcoin/Deps/include" -static -o bitcoind obj/checkpoints.o obj/netbase.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/irc.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/script.o obj/util.o obj/wallet.o   -Wl,-Bstatic -mtl /home/root/Bitcoin/Deps/lib/libboost_system.a -mtl /home/root/Bitcoin/Deps/lib/libboost_filesystem.a -mtl /home/root/Bitcoin/Deps/lib/libboost_program_options.a -mtl /home/root/Bitcoin/Deps/lib/libboost_thread.a /home/root/Bitcoin/Deps/lib/libdb_cxx.a -mtl /home/root/Bitcoin/Deps/lib/libssl.a -mtl /home/root/Bitcoin/Deps/lib/libcrypto.a -lgcc -Wl,-Bstatic -l z -l dl -l pthread
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [bitcoind] Error 1

What is this z library, why isn't it installed, and where can I get it?
legendary
Activity: 1102
Merit: 1014
Paid. These files are now hosted in a git repo at https://github.com/weex/bitcoind-centos
kjj
legendary
Activity: 1302
Merit: 1026
Sure, put them anywhere you think they will be the most useful.

And the address in my signature will be fine.
legendary
Activity: 1102
Merit: 1014
This worked for me without a hitch on both a 32-bit and 64-bit CentOS system. I figure anyone who would have an objection should have said something by now.

Do you mind if I throw these two files up in a git repo?

Please post your address to claim the bounty.
kjj
legendary
Activity: 1302
Merit: 1026
Ok, I may be hung over, but the script is working.

I wanted to just paste it into the forums, but when I do, it messes up the tabs and spaces.  Instead, you'll need to download them.

Build Script
Makefile

Download these two files into a normal user's home directory ( /home/whatever ), set the script executable, then run it.  The script will fetch the packages, build them, then build bitcoind.
sr. member
Activity: 467
Merit: 250

This is just the Steurer guide copied over to a forum. Changing the version is not enough. Let me know if you actually build v0.6 from this and I'll give it a shot.

Well, I went more than half way through and got bored because of the time it took to compile on my VPS,

I went till the Berkeley DB Part, works perfectly till there.
legendary
Activity: 1102
Merit: 1014

This is just the Steurer guide copied over to a forum. Changing the version is not enough. Let me know if you actually build v0.6 from this and I'll give it a shot.
sr. member
Activity: 467
Merit: 250
This should work : http://www.bitcoinforums.net/threads/installing-bitcoind-on-centos-5.146/

From the tutorial :
You may have to replace :
Code:
# cd bitcoin-0.3.23/src

to
Code:
# cd bitcoin-BITCOIN VERSION HERE/src

Replacing BITCOIN VERSION HERE with the version number of bitcoind which gets downloaded from the GIT repo.
I can see the GIT repo was updated 3 days ago which means that you'll get the new version of bitcoind 6 possibly

*If* it does work, send some BTC over to 1HR26mWBjiraHEz1qVPQP5g3LiSjcRpZNy    Tongue
kjj
legendary
Activity: 1302
Merit: 1026
Ok, I can verify that this process works as I now have bitcoind running on CentOS 32-bit! \o/

kjj, would you care to explain any drawbacks to using this procedure? Is the resulting bitcoind lacking anything or is it possible that this build process is likely to introduce problems when used to build later versions of bitcoind?

Heh.  I have no idea, to be honest.  I know it doesn't include UPNP, but that shouldn't be a problem for most people running CentOS.

When I was tweaking the makefile, I kept getting strange warnings about static builds trying to dlopen shared libraries.  I think that will be a problem if someone compiles it on one box, then moves it to a box with different libraries.  I'm not really sure which libraries, if any, would cause those problems.  It could possibly also cause problems if someone updates the libraries on the box it is on.

Also, I saw that someone else had asked for a single document showing all of the steps.  I'm not much of a document sort of guy, but this might be of interest to someone.  Save it as a shell script in your user's home directory, alongside the makefile.new from above.  Then set it executable, and run it.  You should end up with a working bitcoind.  Note that I haven't tested this yet.  I'm running it right now, and so far so good, but boost takes forever to build, so it might not finish before I leave for the bar.  I'll let everyone know how it goes when I can, but that might be tomorrow.

Ignore this script.  It doesn't work, and I don't have time to fix it right now.  Check back tomorrow.

Code:
#!/bin/bash

if [ ! -x /usr/bin/wget ] ; then
 echo "for some silly reason, wget is not executable.  Please fix this (as root do chmod +x /usr/bin/wget) and try again"
 exit
fi

USERNAME=`whoami`
cd ~
mkdir Bitcoin
cd Bitcoin
mkdir Libraries
mkdir Trunk
mkdir Deps
cd Libraries

wget -qO- http://sourceforge.net/projects/boost/files/boost/1.49.0/boost_1_49_0.tar.bz2/download | tar xjv
cd boost_1_49_0
./bootstrap.sh
./bjam --prefix=~$USERNAME/Bitcoin/Deps link=static runtime-link=static install
cd ..

wget -qO- http://openssl.org/source/openssl-1.0.0g.tar.gz | tar xzv
cd openssl-1.0.0g
if uname -a | grep -q x86_64 ; then
 ./Configure no-shared --prefix=~$USERNAME/Bitcoin/Deps --openssldir=~$USERNAME/Bitcoin/Deps/openssl linux-x86_64
else
 ./Configure no-shared --prefix=~$USERNAME/Bitcoin/Deps --openssldir=~$USERNAME/Bitcoin/Deps/openssl linux-generic32
fi
make
make install
cd ..

wget -qO- http://download.oracle.com/berkeley-db/db-5.1.19.tar.gz | tar xzv
cd db-5.1.19/build_unix
../dist/configure --prefix=~$USERNAME/Deps/ --enable-cxx
make
make install
cd ../..

mkdir bitcoin-master
cd bitcoin-master
wget -qO- https://github.com/bitcoin/bitcoin/tarball/master --no-check-certificate | tar xzv --strip-components 1
cd src
#cp -vap ~$USERNAME/makefile.new .
cat ~$USERNAME/makefile.new | sed s/kjj/$USERNAME/g > makefile.new
make -f makefile.new bitcoind
legendary
Activity: 1102
Merit: 1014
Ok, I can verify that this process works as I now have bitcoind running on CentOS 32-bit! \o/

kjj, would you care to explain any drawbacks to using this procedure? Is the resulting bitcoind lacking anything or is it possible that this build process is likely to introduce problems when used to build later versions of bitcoind?
kjj
legendary
Activity: 1302
Merit: 1026
kjj, can you post your modified makefile? patch fails for me and I'm not sure if it's whitespace or what...

I found with openssl that it doesn't like relative paths so it's probably best to make these build instructions use only absolute paths throughout.

In regards to the bounty and the hackiness of this approach, who will bless it?  If it works and is presented in a single document, I would be inclined to call it done.

makefile.new below.  The make command was make -f makefile.new bitcoind

Code:
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.

USE_UPNP:=

DEFS=-DNOPCH

DEFS += $(addprefix -I,$(CURDIR) $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))

DEPSDIR=/home/kjj/Bitcoin/Deps
INCLUDEPATHS= -I"$(DEPSDIR)/include"
LIBPATHS= -L"$(DEPSDIR)/lib"
BOOST_LIB_SUFFIX=.a
BDB_LIB_SUFFIX=.a
CRYPTO_LIB_SUFFIX=.a

LMODE2 = static
LMODE = static

# for boost 1.37, add -mt to the boost libraries
LIBS += \
 -Wl,-Bstatic \
   -mtl $(DEPSDIR)/lib/libboost_system$(BOOST_LIB_SUFFIX) \
   -mtl $(DEPSDIR)/lib/libboost_filesystem$(BOOST_LIB_SUFFIX) \
   -mtl $(DEPSDIR)/lib/libboost_program_options$(BOOST_LIB_SUFFIX) \
   -mtl $(DEPSDIR)/lib/libboost_thread$(BOOST_LIB_SUFFIX) \
   $(DEPSDIR)/lib/libdb_cxx$(BDB_LIB_SUFFIX) \
   -mtl $(DEPSDIR)/lib/libssl.a \
   -mtl $(DEPSDIR)/lib/libcrypto$(CRYPTO_LIB_SUFFIX) \
   -lgcc

ifndef USE_UPNP
        override USE_UPNP = -
endif
ifneq (${USE_UPNP}, -)
        LIBS += -l miniupnpc
        DEFS += -DUSE_UPNP=$(USE_UPNP)
endif

ifneq (${USE_SSL}, 0)
        DEFS += -DUSE_SSL
endif

LIBS+= \
 -Wl,-B$(LMODE2) \
   -l z \
   -l dl \
   -l pthread


# Hardening
# Make some classes of vulnerabilities unexploitable in case one is discovered.
#
    # This is a workaround for Ubuntu bug #691722, the default -fstack-protector causes
    # -fstack-protector-all to be ignored unless -fno-stack-protector is used first.
    # see: https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/691722
    HARDENING=-fno-stack-protector

    # Stack Canaries
    # Put numbers at the beginning of each stack frame and check that they are the same.
    # If a stack buffer if overflowed, it writes over the canary number and then on return
    # when that number is checked, it won't be the same and the program will exit with
    # a "Stack smashing detected" error instead of being exploited.
    HARDENING+=-fstack-protector-all -Wstack-protector

    # Make some important things such as the global offset table read only as soon as
    # the dynamic linker is finished building it. This will prevent overwriting of addresses
    # which would later be jumped to.
    HARDENING+=-Wl,-z,relro -Wl,-z,now

    # Build position independent code to take advantage of Address Space Layout Randomization
    # offered by some kernels.
    # see doc/build-unix.txt for more information.
    ifdef PIE
        HARDENING+=-fPIE -pie
    endif

    # -D_FORTIFY_SOURCE=2 does some checking for potentially exploitable code patterns in
    # the source such overflowing a statically defined buffer.
    HARDENING+=-D_FORTIFY_SOURCE=2
#


DEBUGFLAGS=-g
CXXFLAGS=-O2
xCXXFLAGS=-pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat-security \
    $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS) $(INCLUDEPATHS) -static

OBJS= \
    obj/checkpoints.o \
    obj/netbase.o \
    obj/crypter.o \
    obj/key.o \
    obj/db.o \
    obj/init.o \
    obj/irc.o \
    obj/keystore.o \
    obj/main.o \
    obj/net.o \
    obj/protocol.o \
    obj/bitcoinrpc.o \
    obj/rpcdump.o \
    obj/script.o \
    obj/util.o \
    obj/wallet.o


all: bitcoind

# auto-generated dependencies:
-include obj/*.P
-include obj-test/*.P

obj/%.o: %.cpp
        $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
        @cp $(@:%.o=%.d) $(@:%.o=%.P); \
          sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
              -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
          rm -f $(@:%.o=%.d)

bitcoind: $(OBJS:obj/%=obj/%)
        $(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)

TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))

obj-test/%.o: test/%.cpp
        $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -o $@ $<
        @cp $(@:%.o=%.d) $(@:%.o=%.P); \
          sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
              -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
          rm -f $(@:%.o=%.d)

test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
        $(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(LDFLAGS) $(LIBS)

clean:
        -rm -f bitcoind test_bitcoin
        -rm -f obj/*.o
        -rm -f obj-test/*.o
        -rm -f obj/*.P
        -rm -f obj-test/*.P
legendary
Activity: 1102
Merit: 1014
kjj, can you post your modified makefile? patch fails for me and I'm not sure if it's whitespace or what...

I found with openssl that it doesn't like relative paths so it's probably best to make these build instructions use only absolute paths throughout.

In regards to the bounty and the hackiness of this approach, who will bless it?  If it works and is presented in a single document, I would be inclined to call it done.
legendary
Activity: 1102
Merit: 1014
My bad, this os isn't 64 bit after all...will report back on the rest.
kjj
legendary
Activity: 1302
Merit: 1026
Really?  I just nuked my directory to start over, and did:

Code:
tar xzvf ../../openssl-1.0.0g.tar.gz
cd openssl-1.0.0g/
./Configure no-shared --prefix=~/Bitcoin/Deps --openssldir=~/Bitcoin/Deps/openssl linux-x86_64
make depend
make

with no errors.

What was the output of your uname -a ?
legendary
Activity: 1102
Merit: 1014
Ok, I'll give kjj's a shot as soon as I can.

Update: no luck as I got the following error on 'make depend'

Code:
Configured for linux-x86_64.
[weex@centos openssl-1.0.0g]$ make depend
making depend in crypto...
make[1]: Entering directory `/home/weex/code/Bitcoin/Libraries/openssl-1.0.0g/crypto'
cryptlib.c:0: sorry, unimplemented: 64-bit mode not compiled in
mem.c:0: sorry, unimplemented: 64-bit mode not compiled in
mem_clr.c:0: sorry, unimplemented: 64-bit mode not compiled in
mem_dbg.c:0: sorry, unimplemented: 64-bit mode not compiled in
cversion.c:0: sorry, unimplemented: 64-bit mode not compiled in
ex_data.c:0: sorry, unimplemented: 64-bit mode not compiled in
cpt_err.c:0: sorry, unimplemented: 64-bit mode not compiled in
ebcdic.c:0: sorry, unimplemented: 64-bit mode not compiled in
uid.c:0: sorry, unimplemented: 64-bit mode not compiled in
o_time.c:0: sorry, unimplemented: 64-bit mode not compiled in
o_str.c:0: sorry, unimplemented: 64-bit mode not compiled in
o_dir.c:0: sorry, unimplemented: 64-bit mode not compiled in
make[1]: *** [depend] Error 1
make[1]: Leaving directory `/home/weex/code/Bitcoin/Libraries/openssl-1.0.0g/crypto'
make: *** [depend] Error 1
kjj
legendary
Activity: 1302
Merit: 1026
If you want the other links, they are:

Boost 1.49.0, or go here and pick the latest version.

openSSL-1.0.0g, or go here and pick a different release.  No idea if the betas are any good.

For BDB, go here and click the blue Download link.  Or, skip the splash pages and download 5.1.19 directly.

I didn't include them before because I figured it was easy enough for other people to copy the links out of that PDF and navigate to the current versions.

Oh, and I noticed one other thing that I did differently from the guide.  I'll edit the post to include it.

And just for fun, here is a my centos box running bitcoind, busily downloading the blockchain...

Code:
[kjj@crs00 src]$ cat /etc/redhat-release
CentOS release 5.7 (Final)
[kjj@crs00 src]$ ./bitcoind getinfo
{
    "version" : 60000,
    "protocolversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 138239,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 1690895.80305239,
    "testnet" : false,
    "keypoololdest" : 1330099058,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "errors" : ""
}
[kjj@crs00 src]$
kjj
legendary
Activity: 1302
Merit: 1026
Used version 1.49.0 of Boost
Used version 1.0.0g of openssl

How do you get boost 1.49.0 to compile?  The latest version that comes packaged for CentOS is 1.33.1

Same for openssl, the latest packaged version is 0.9.8e

The 3.22 recipe goes through great many hoops, including download links to long gone tarballs of legacy versions of those pesky libraries.  It's self-contained and requires nothing more than a CentOS install DVD, and a 3.22 git mirror.  One can follow the instructions and actually build 3.22 (for x86, and with tiny fixes also for x64).

However, requiring boost 1.49.0 without saying how to make it is not going to help.  I know because I once tried to build a recent bitcoin, and failed (after 2 days of dependency hell).

I followed the instructions in the guide that I linked exactly, with the exceptions noted.
newbie
Activity: 53
Merit: 0
Used version 1.49.0 of Boost
Used version 1.0.0g of openssl

How do you get boost 1.49.0 to compile?  The latest version that comes packaged for CentOS is 1.33.1

Same for openssl, the latest packaged version is 0.9.8e

The 3.22 recipe goes through great many hoops, including download links to long gone tarballs of legacy versions of those pesky libraries.  It's self-contained and requires nothing more than a CentOS install DVD, and a 3.22 git mirror.  One can follow the instructions and actually build 3.22 (for x86, and with tiny fixes also for x64).

However, requiring boost 1.49.0 without saying how to make it is not going to help.  I know because I once tried to build a recent bitcoin, and failed (after 2 days of dependency hell).
legendary
Activity: 1316
Merit: 1011
downloading centos now going to install in VM, I'm fairly confiant I can get this bounty  Cheesy
kjj
legendary
Activity: 1302
Merit: 1026
I just followed the instructions in the Steurer guide with the following exceptions:

Used version 1.49.0 of Boost, adjust the ./bjam line for --prefix=../../Deps
Used version 1.0.0g of openssl, add no-shared to the ./Configuration line and run make depend before make
Used the master tarball of bitcoin instead of git clone
Different makefile, using this patch fix the DEPSDIR= line to match your path:

Code:
--- makefile.unix       2012-02-23 13:33:30.000000000 -0500
+++ makefile.new        2012-02-24 10:57:14.000000000 -0500
@@ -2,34 +2,34 @@
 # Distributed under the MIT/X11 software license, see the accompanying
 # file license.txt or http://www.opensource.org/licenses/mit-license.php.

-USE_UPNP:=0
+USE_UPNP:=

 DEFS=-DNOPCH

 DEFS += $(addprefix -I,$(CURDIR) $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
 LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))

-LMODE = dynamic
-LMODE2 = dynamic
-ifdef STATIC
-       LMODE = static
-       ifeq (${STATIC}, all)
-               LMODE2 = static
-       endif
-else
-       TESTDEFS += -DBOOST_TEST_DYN_LINK
-endif
+DEPSDIR=/home/kjj/Bitcoin/Deps
+INCLUDEPATHS= -I"$(DEPSDIR)/include"
+LIBPATHS= -L"$(DEPSDIR)/lib"
+BOOST_LIB_SUFFIX=.a
+BDB_LIB_SUFFIX=.a
+CRYPTO_LIB_SUFFIX=.a
+
+LMODE2 = static
+LMODE = static

 # for boost 1.37, add -mt to the boost libraries
 LIBS += \
- -Wl,-B$(LMODE) \
-   -l boost_system$(BOOST_LIB_SUFFIX) \
-   -l boost_filesystem$(BOOST_LIB_SUFFIX) \
-   -l boost_program_options$(BOOST_LIB_SUFFIX) \
-   -l boost_thread$(BOOST_LIB_SUFFIX) \
-   -l db_cxx$(BDB_LIB_SUFFIX) \
-   -l ssl \
-   -l crypto
+ -Wl,-Bstatic \
+   -mtl $(DEPSDIR)/lib/libboost_system$(BOOST_LIB_SUFFIX) \
+   -mtl $(DEPSDIR)/lib/libboost_filesystem$(BOOST_LIB_SUFFIX) \
+   -mtl $(DEPSDIR)/lib/libboost_program_options$(BOOST_LIB_SUFFIX) \
+   -mtl $(DEPSDIR)/lib/libboost_thread$(BOOST_LIB_SUFFIX) \
+   $(DEPSDIR)/lib/libdb_cxx$(BDB_LIB_SUFFIX) \
+   -mtl $(DEPSDIR)/lib/libssl.a \
+   -mtl $(DEPSDIR)/lib/libcrypto$(CRYPTO_LIB_SUFFIX) \
+   -lgcc

 ifndef USE_UPNP
        override USE_UPNP = -
@@ -86,7 +86,7 @@
 DEBUGFLAGS=-g
 CXXFLAGS=-O2
 xCXXFLAGS=-pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat-security \
-    $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
+    $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS) $(INCLUDEPATHS) -static

 OBJS= \
     obj/checkpoints.o \


And then just make -f makefile.new bitcoind.

This is an ugly hack and I really don't know what I'm doing.  Please save the bounty until someone better gives the proper solution.
legendary
Activity: 1102
Merit: 1014
It can't really be much harder than building for any other linux OS right?

I'm sure it isn't...for someone who will with the bounty.
full member
Activity: 209
Merit: 100
It can't really be much harder than building for any other linux OS right?
legendary
Activity: 1102
Merit: 1014
Another interested party has added 2 BTC to the bounty so I've updated the topic.
legendary
Activity: 1024
Merit: 1004
I'll take a swing at it since I was able to get it to build on FreeBSD 7.1 (32-bit) and 8.2 (64-bit) Wink

The only thing crazier than that would be, I dunno, OS/2 or AmigaDOS Wink
legendary
Activity: 1102
Merit: 1014
Sweet. This is a rather large hole in practical Bitcoin implementation so I'm imagining a large number of sysadmins will appreciate this in advance.
vip
Activity: 980
Merit: 1001
I'm pretty sure I know someone that can help.
PM'd him the link for when he wakes up Smiley
legendary
Activity: 1102
Merit: 1014
Hello,

Does anyone have a build of the latest bitcoind for Redhat/CentOS? The instructions I followed from a thread here for 0.3.22 no longer work for the latest source releases. Can it be that everyone running CentOS is still on 0.3.22?

For the bounty, I'll start it at 3 BTC. You'll get the proceeds if you post build instructions that work on CentOS 5 x64 and x86. If you want to contribute to this bounty, send to: 1ErJsCgWZowPykwkBKpE3ueg5V8f521EbE

Update: The bounty has been paid and a working build script is now hosted at https://github.com/weex/bitcoind-centos

Update: Keeping this working is quite a challenge over time so the original bounty solution no longer works. Thanks to neozonz for providing an unpaid update referenced in this post: https://bitcointalksearch.org/topic/m.2624660 I'll try to keep this OP updated with what works currently so PM weex if you have any concerns.

Thanks!

-weex
Jump to: