8

There are instructions for building on Ubuntu/Debian, but I want to build it in Fedora.

Nick ODell
  • 29,184
  • 11
  • 69
  • 129
hgajshb
  • 183
  • 1
  • 3

4 Answers4

3

This is how I compiled bitcoind from the github source on Fedora 18.

sudo yum install gcc-c++ make
sudo yum install boost-devel 
sudo yum install db4-devel
sudo yum install openssl-devel
sudo yum install rpm-build
sudo yum install lynx
sudo yum install python-devel
sudo yum install miniupnpc
sudo yum install miniupnpc-devel.i686
sudo yum install libdb-cxx.i686
sudo yum install libdb-cxx-devel.i686

now grab the latest tarball from: http://www.openssl.org/source/ save and untar it in a directory, let's say ~/installs/openssl_ecdsa

cd ~/installs/openssl_ecdsa
./config
make
sudo make install

now pull the latest bitcoin source from github

cd ~
git clone https://github.com/bitcoin/bitcoin.git

if you want the latest stable release, checkout the version number here: http://bitcoin.org/en/download

git checkout 0.8.3 //latest stable at the moment
cd bitcoin/src
export OPENSSL_INCLUDE_PATH="/usr/local/ssl/include"
export OPENSSL_LIB_PATH="/usr/local/ssl/lib"
make -f makefile.unix
Stéphane Gimenez
  • 5,104
  • 3
  • 31
  • 37
Todamont
  • 31
  • 2
  • 2
    You **really** shouldn't be doing a `sudo make install` on OpenSSL. This could potentially break your system. – Tom van der Woerdt Aug 04 '13 at 08:58
  • I didn't notice any problems. You could just do the make step and then point the export commands to ~/installs/openssl_ecdsa, in the above instructions. –  Aug 08 '13 at 16:55
  • Also worked for me on Fedora 17, thanks! – iforce2d Oct 21 '13 at 04:07
  • @TomvanderWoerdt Can you elaborate please? – Petr Peller Dec 16 '13 at 22:34
  • @Petr Peller not entirely sure as my background is Oracle DBA and not directly Linux or UNIX (but came here to solve my problem with Bitcoin and Litecoin on CentOS) but i guess this: SSL is used for encryption of network packets so if something goes wrong with that then decryption might fail... making secure connections no longer possible By make install you make your version of SSL install everywhere available for use on the whole system, not just to be used by your coin software and without your control. This can cause serious trouble. –  Feb 20 '14 at 23:26
3

You will have to rebuild OpenSSL, since the build shipped by Fedora/Red Hat does not include support for elliptic curve cryptography, on which Bitcoin relies. So you have to build your own.

Once that's done, you can get on with building Bitcoin normally, provided you point it at your private build of OpenSSL with -rpath.

Or, you can just skip all the work and use my existing Yum repository. This also gives you standards-compliant paths, as well as an SELinux-enabled bitcoind. Read the RPM spec files if you're really interested in the build process.

Michael Hampton
  • 237
  • 1
  • 13
0

Tested on Fedora 20, 64-bit:

$ sudo yum groupinstall -y "Development Tools" "Development Libraries"
$ sudo yum install -y gcc-c++ libtool swig pyqt4-devel python-psutil python-twisted wget protobuf-devel
$ wget -qO- 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' | tar -xzv && cd db*/build_unix
$ ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/usr/local/
$ make
$ sudo make install
$ cd; wget -qO- https://www.openssl.org/source/openssl-1.0.1i.tar.gz | tar -xzv && cd o*
$ export CFLAGS="-fPIC"; ./config --prefix=/usr/local shared enable-ec enable-ecdh enable-ecdsa
$ make depend && make all
$ sudo make install
$ cd; git clone git://github.com/bitcoin/bitcoin.git; cd bitcoin
$ ./autogen.sh && ./configure LDFLAGS="-Wl,-rpath=/usr/local/lib64 -L/usr/local/lib/ -L/usr/local/lib64/" CPPFLAGS="-I/usr/local/include/"
$ make
$ sudo make install
$ mkdir ~/.bitcoin; wget -O ~/.bitcoin/bitcoin.conf https://raw.githubusercontent.com/averageradical/compile/gh-pages/example/bitcoin.conf
$ bitcoin-qt # or nohup bitcoind &
$ bitcoin-cli help
0

You'll need to install these libraries:

  • libssl - provided by openssl in Fedora
  • libboost - called boost in Fedora
  • libdb4.8 - called db4.8 in Fedora
  • miniupnpc

I'm not able to test this at the moment, but try something like this:

yum install openssl boost db4.8 miniupnpc

Once those are installed, and their src or dev packages may be necessary, you can do the actual build itself:

cd src/
make -f makefile.unix

Also requires openssl-devel

Colin Dean
  • 7,014
  • 3
  • 30
  • 58
  • 1
    `In file included from alert.cpp:9:0:`
    `key.h:16:49: fatal error: openssl/ec.h: No such file or directory`
    `compilation terminated.`
    Maybe related to the [bug](https://bugzilla.redhat.com/show_bug.cgi?id=319901)?
    – hgajshb Feb 26 '13 at 00:30
  • And there is no package db4.8, not at least in the default Fedora 18 repo. Is it in source repo? – hgajshb Feb 26 '13 at 00:38
  • 1
    To solve the OpenSSL issue, try building from source using the following command: `./config --prefix=/usr/local enable-ec enable-ecdh enable-ecdsa` This worked for a Primecoin build, which I believe has similar internals to Bitcoin. –  Jul 27 '13 at 18:40