Bitcoin Forum
May 04, 2024, 06:08:42 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Building in CentOS 5.6  (Read 3697 times)
ryepdx (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 500


View Profile
April 20, 2011, 09:38:23 AM
 #1

Anyone have experience building bitcoind in CentOS 5.6? I've been trying, but the list of dependencies keeps growing. Some sort of procedure/script (or even a binary, if you've got one) would be incredibly helpful!

Thanks. :-)
1714802922
Hero Member
*
Offline Offline

Posts: 1714802922

View Profile Personal Message (Offline)

Ignore
1714802922
Reply with quote  #2

1714802922
Report to moderator
1714802922
Hero Member
*
Offline Offline

Posts: 1714802922

View Profile Personal Message (Offline)

Ignore
1714802922
Reply with quote  #2

1714802922
Report to moderator
Every time a block is mined, a certain amount of BTC (called the subsidy) is created out of thin air and given to the miner. The subsidy halves every four years and will reach 0 in about 130 years.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714802922
Hero Member
*
Offline Offline

Posts: 1714802922

View Profile Personal Message (Offline)

Ignore
1714802922
Reply with quote  #2

1714802922
Report to moderator
1714802922
Hero Member
*
Offline Offline

Posts: 1714802922

View Profile Personal Message (Offline)

Ignore
1714802922
Reply with quote  #2

1714802922
Report to moderator
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
April 20, 2011, 10:47:46 AM
 #2

As I noted in the other thread where you asked this question, you can't. Red Hat stripped out all the ECC code from OpenSSL. And all the other stuff is too old.

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
ryepdx (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 500


View Profile
April 20, 2011, 04:22:18 PM
 #3

Actually I did some searching on the forums and saw that this has been done at least twice under CentOS 5.5 with prior versions of the client, so unless something fundamental has changed about the client since 0.3.13, I know it's possible:
http://bitcointalk.org/index.php?topic=311.0
http://bitcointalk.org/index.php?topic=1519.0

I was hoping someone had done the same with the latest version of the client as I need the JSON-RPC interface introduced in 0.3.14. I tried following the instructions posted at http://heliacal.net/~solar/bitcoin/bitcoin-linuxbuild.pdf but ran into trouble with trying to install wxWidgets on my shared hosting and running out of memory while trying to compile Boost on my VPS.

Any insights?

Thanks.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12968


View Profile
April 20, 2011, 05:07:01 PM
 #4

As I noted in the other thread where you asked this question, you can't. Red Hat stripped out all the ECC code from OpenSSL. And all the other stuff is too old.

You can -- you just have to compile the dependencies, as well.

I was hoping someone had done the same with the latest version of the client as I need the JSON-RPC interface introduced in 0.3.14. I tried following the instructions posted at http://heliacal.net/~solar/bitcoin/bitcoin-linuxbuild.pdf but ran into trouble with trying to install wxWidgets on my shared hosting and running out of memory while trying to compile Boost on my VPS.

wxWidgets isn't required for bitcoind.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
trentzb
Sr. Member
****
Offline Offline

Activity: 406
Merit: 251


View Profile
April 20, 2011, 05:11:01 PM
 #5

Is there a reason you are trying to build against wxWidgets on a shared hosting environment?
ryepdx (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 500


View Profile
April 20, 2011, 06:14:31 PM
 #6

Is there a reason you are trying to build against wxWidgets on a shared hosting environment?

Because I was getting errors about wxWidgets missing when I tried to build bitcoind.

However, I'm running up against a new problem now. I re-wrote my makefile, taking fewer departures from the one posted on heliacal.net, and ended up with this error:
make: *** No rule to make target `obj/nogui/util.o', needed by `bitcoind'.  Stop.

Any ideas why this might be?

makefile.unix
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/mitlicense.php.
DEPSDIR=/home/bitcoin/deps
INCLUDEPATHS= \
 -I"$(DEPSDIR)/include"
LIBPATHS= \
 -L"$(DEPSDIR)/lib"
WXLIBS=$(shell $(DEPSDIR)/bin/wx-config --libs --static)
WXBASELIBS=$(shell $(DEPSDIR)/bin/wx-config --libs base --static)
LIBS= -dead_strip \
 $(DEPSDIR)/lib/libdb_cxx-4.8.a \
 $(DEPSDIR)/lib/libboost_system.a \
 $(DEPSDIR)/lib/libboost_filesystem.a \ $(DEPSDIR)/lib64/libcrypto.a
WXDEFS=$(shell $(DEPSDIR)/bin/wx-config --cxxflags) -DNOPCH
DEBUGFLAGS=-g -DwxDEBUG_LEVEL=0
CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
    script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin
headers.h.gch: headers.h $(HEADERS)
        g++ -c $(CFLAGS) -o $@ $<
obj/%.o: %.cpp $(HEADERS) headers.h.gch
        g++ -c $(CFLAGS) -o $@ $<
obj/sha.o: sha.cpp sha.h
        g++ -c $(CFLAGS) -O3 -o $@ $<
OBJS= \
    obj/util.o \
    obj/script.o \
    obj/db.o \
    obj/net.o \
    obj/irc.o \
    obj/main.o \
    obj/rpc.o \
    obj/init.o

bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha.o
        g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)

obj/nogui/%.o: %.cpp $(HEADERS)
        g++ -c $(CFLAGS) -DwxUSE_GUI=0 -o $@ $<

bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha.o
        g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXBASELIBS) $(LIBS)

clean:-rm -f bitcoin bitcoind
        -rm -f obj/*
        -rm -f obj/nogui/*
        -rm -f headers.h.gch
# end

I was under the impression "obj/nogui/%.o" would handle that rule...
trentzb
Sr. Member
****
Offline Offline

Activity: 406
Merit: 251


View Profile
April 20, 2011, 07:35:29 PM
 #7

On Ubuntu I do:

Code:
tar xfz bitcoin-0.3.20.2-linux.tar.gz
cd bitcoin-0.3.20.2/src && mkdir -p obj/nogui
rm cryptopp/obj/*.o
make -f makefile.unix bitcoind
./bitcoind -?

Should be pretty close to the same on CentOS (no wxWidgets needed). What boost version is installed? You may need to adjust -mt in your makefile.unix.
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
April 20, 2011, 09:22:52 PM
 #8

As I noted in the other thread where you asked this question, you can't. Red Hat stripped out all the ECC code from OpenSSL. And all the other stuff is too old.

You can -- you just have to compile the dependencies, as well.

True enough, but then you have the responsibility of making sure you don't break the rest of your system by replacing the system libraries with your own libraries. This is not a task for the faint of heart, and maybe not for those unfamiliar with reading and building C/C++ source code.

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12968


View Profile
April 20, 2011, 09:30:00 PM
 #9

True enough, but then you have the responsibility of making sure you don't break the rest of your system by replacing the system libraries with your own libraries. This is not a task for the faint of heart, and maybe not for those unfamiliar with reading and building C/C++ source code.

Just --prefix everything into your home directory. If you do it as a non-root user, there's no way you can destroy the system.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
trentzb
Sr. Member
****
Offline Offline

Activity: 406
Merit: 251


View Profile
April 20, 2011, 09:50:57 PM
 #10

On Ubuntu I do:

Code:
tar xfz bitcoin-0.3.20.2-linux.tar.gz
cd bitcoin-0.3.20.2/src && mkdir -p obj/nogui
rm cryptopp/obj/*.o
make -f makefile.unix bitcoind
./bitcoind -?

mkdir -p obj/nogui and rm cryptopp/obj/*.o not needed on RC.

ryepdx (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 500


View Profile
April 20, 2011, 11:10:00 PM
 #11

Okay, I was able to build the dependencies I was lacking into a "deps" folder in my home, including OpenSSL. But now it seems the compiler can't find OpenSSL. :-/

Here is the beginning of the error I get:
Code:
[root@vps src]# make -f makefile.unix.new bitcoind
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL -I"/home/bitcoin/deps/include" -I"/home/bitcoin/boost_1_46_1" -I"/home/bitcoin/deps/openssl" -I"/home/bitcoin/deps" -o obj/nogui/util.o util.cpp
In file included from util.cpp:5:
headers.h:37:28: error: openssl/buffer.h: No such file or directory
headers.h:38:27: error: openssl/ecdsa.h: No such file or directory
headers.h:39:25: error: openssl/evp.h: No such file or directory
headers.h:40:26: error: openssl/rand.h: No such file or directory
headers.h:41:25: error: openssl/sha.h: No such file or directory
headers.h:42:28: error: openssl/ripemd.h: No such file or directory
headers.h:43:20: error: db_cxx.h: No such file or directory
In file included from headers.h:120,
                 from util.cpp:5:
bignum.h:7:24: error: openssl/bn.h: No such file or directory

Any idea why this isn't working? OpenSSL was built with --prefix /home/bitcoin/deps/openssl

Thanks for all the help, guys.

Edit:
I've also tried running this with /home/bitcoin/deps/openssl in my includes, but to no avail. I've even tried renaming the includes folder (which contains the files headers.h is complaining about) to "openssl" and replacing its parent folder in the "deps" folder with it, but it's been no use.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12968


View Profile
April 20, 2011, 11:55:37 PM
 #12

Probably you have to give the include path as /home/bitcoin/deps/openssl/include. The include directory should contain an "openssl" directory, and this directory should contain the files that make could not find.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
ryepdx (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 500


View Profile
April 21, 2011, 02:38:01 AM
Last edit: April 21, 2011, 11:24:55 PM by ryepdx
 #13

Yeah... I did that... and it didn't work.    Undecided

I'm considering just switching to a Debian-based VPS at this point. But then again most servers out there seem to be running CentOS, so having a working bitcoind for CentOS could prove to be super-useful to other people who might want to get it running on their server for one reason or another.

Edit:
In the end I decided that beating my head against this wall wasn't worth it. Too much time had been taken up trying to compile the server and I couldn't afford to waste more. On top of that, I still had a few weeks left in the hosting services 30 day money back guarantee. I canceled my account, got my money back, moved to an Ubuntu-based VPS, and life was good again. I hope to release the alpha version of my bitcoin service in the next few days. :-)
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!