weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
February 23, 2012, 02:45:34 AM Last edit: July 09, 2013, 07:52:00 PM by weex |
|
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: 1ErJsCgWZowPykwkBKpE3ueg5V8f521EbEUpdate: The bounty has been paid and a working build script is now hosted at https://github.com/weex/bitcoind-centosUpdate: 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://bitcointalk.org/index.php?topic=65818.msg2624660#msg2624660 I'll try to keep this OP updated with what works currently so PM weex if you have any concerns. Thanks! -weex
|
|
|
|
Graet
VIP
Legendary
Offline
Activity: 980
Merit: 1001
|
|
February 23, 2012, 03:08:40 AM |
|
I'm pretty sure I know someone that can help. PM'd him the link for when he wakes up
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
February 23, 2012, 03:17:23 AM |
|
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.
|
|
|
|
TheLittleDuke
Legendary
Offline
Activity: 1024
Merit: 1004
|
|
February 23, 2012, 05:01:05 AM |
|
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) The only thing crazier than that would be, I dunno, OS/2 or AmigaDOS
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
February 23, 2012, 04:50:00 PM |
|
Another interested party has added 2 BTC to the bounty so I've updated the topic.
|
|
|
|
stcupp
|
|
February 24, 2012, 07:10:11 AM |
|
It can't really be much harder than building for any other linux OS right?
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
February 24, 2012, 07:22:56 AM |
|
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.
|
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1026
|
|
February 24, 2012, 04:05:37 PM Last edit: February 24, 2012, 06:05:50 PM by kjj |
|
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=../../DepsUsed version 1.0.0g of openssl, add no-shared to the ./Configuration line and run make depend before makeUsed the master tarball of bitcoin instead of git clone Different makefile, using this patch fix the DEPSDIR= line to match your path: --- 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.
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
chris200x9
Legendary
Offline
Activity: 1316
Merit: 1011
|
|
February 24, 2012, 04:55:58 PM |
|
downloading centos now going to install in VM, I'm fairly confiant I can get this bounty
|
|
|
|
jetmine
Newbie
Offline
Activity: 53
Merit: 0
|
|
February 24, 2012, 05:35:32 PM |
|
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).
|
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1026
|
|
February 24, 2012, 05:54:15 PM |
|
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.
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1026
|
|
February 24, 2012, 06:04:33 PM |
|
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... [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]$
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
February 24, 2012, 06:25:54 PM Last edit: February 24, 2012, 07:59:18 PM by weex |
|
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' 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
Offline
Activity: 1302
Merit: 1026
|
|
February 24, 2012, 08:14:34 PM |
|
Really? I just nuked my directory to start over, and did: 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 ?
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
February 24, 2012, 08:23:41 PM |
|
My bad, this os isn't 64 bit after all...will report back on the rest.
|
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
February 24, 2012, 10:48:23 PM |
|
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.
|
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1026
|
|
February 24, 2012, 11:44:17 PM |
|
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# 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
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
weex (OP)
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
February 25, 2012, 12:06:30 AM |
|
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
Offline
Activity: 1302
Merit: 1026
|
|
February 25, 2012, 12:46:57 AM Last edit: February 25, 2012, 01:26:39 AM by kjj |
|
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.#!/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
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
CrownCloud
|
|
February 25, 2012, 06:35:30 PM |
|
This should work : http://www.bitcoinforums.net/threads/installing-bitcoind-on-centos-5.146/From the tutorial : You may have to replace : to # 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
|
CrownCloud - Internet Services Dedicated servers, OpenVZ and KVM based VPSes and in 4 locations. (We accept Bitcoin !) http://crowncloud.net/
|
|
|
|