<p>Nick ODell <a href="https://bitcoin.stackexchange.com/questions/55269/how-do-i-compile-core-0-8-6-on-ubuntu-ec2?noredirect=1#comment64244_55269">pointed</a> me to the <a href="https://github.com/bitcoin/bitcoin/issues/6113#issuecomment-298234393" rel="nofollow noreferrer">solution</a>:</p>

<p>Edit <code>rpcrawtransaction.cpp</code> and change:</p>

<pre><code>const CScriptID&amp; hash = boost::get&lt;const CScriptID&amp;&gt;(address);
</code></pre>

<p>To:</p>

<pre><code>const CScriptID&amp; hash = boost::get&lt;CScriptID&gt;(address);
</code></pre>

<p>This was sufficient to get it to compile.</p>

<p>In addition I applied the OpenSSL <a href="https://github.com/bitcoin/bitcoin/pull/5634/files" rel="nofollow noreferrer">patch</a> Pieter Wuille <a href="https://bitcoin.stackexchange.com/questions/55269/how-do-i-compile-core-0-8-6-on-ubuntu-ec2?noredirect=1#comment64263_55269">pointed out</a>.</p>

<p>You have to do this manually because <code>depends/packages/openssl.mk</code> no longer exists, and the function name and signature has changed. Simply open <code>src/key.cpp</code> and replace everything inside the <code>CKey::Verify</code> function brackets with <a href="https://github.com/theuni/bitcoin/blob/8dccba6a45db0466370726ed462b9da2eae43bce/src/ecwrapper.cpp#L120-L136" rel="nofollow noreferrer">this new version</a>.</p>

<p>More than 210,000 blocks synced so far, so I'm assuming this worked. </p>

CC BY-SA 3.0
2017-07-06T10:43:41.437Z
2017-07-06T12:38:33.540Z
2017-07-06T12:38:33.540Z
Sjors Provoost
<p>You can use the gitian build system. Instructions for building 0.8.x with gitian are available here: <a href="https://github.com/bitcoin/bitcoin/tree/0.8/contrib/gitian-descriptors" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/tree/0.8/contrib/gitian-descriptors</a> and here: <a href="https://github.com/bitcoin/bitcoin/blob/0.8/doc/release-process.md" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/0.8/doc/release-process.md</a>. Using gitian should get you exactly the same binaries as those that were released.</p>

CC BY-SA 3.0
2017-07-05T18:06:34.750Z
Thanks, that's a great opportunity to learn about Gitian. I'll mark your answer as Accepted if that works out.
Sjors Provoost
CC BY-SA 3.0
2017-07-06T09:22:03.167Z
Unfortunately this won't work out of the box on EC2 (T2):
`sudo /usr/sbin/kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used`

It looks like I would have to use something fancy like [Ravello](https://www.ravellosystems.com/blog/run-nested-kvm-on-aws-google/), or am I missing something?
Sjors Provoost
CC BY-SA 3.0
2017-07-06T16:33:50.043Z
IIRC EC2 itself is a VM, so you can't use KVM in it. However, you should be able to use LXC and there are instructions for that at the bottom of the first link I posted (ignore the virtualbox stuff). You will need to do the `make-base-vm` commands with the `--lxc` option too.
Ava Chow
CC BY-SA 3.0
2017-07-05T17:53:32.773Z
2017-07-05T17:53:32.773Z
Ava Chow
<p>I'm trying to compile v0.8.6 of the core client from <a href="https://github.com/bitcoin/bitcoin/releases/tag/v0.8.6" rel="nofollow noreferrer">source</a>, in order to compare IDB (Initial Blockchain Download) performance between versions.</p>

<p>I created a fresh Ubuntu Xenial 16.04 machine on Amazon EC2. I then ran the following commands (which were sufficient for version 0.9.3 and up):</p>

<pre><code>sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential autoconf libboost-all-dev \
                     libssl-dev libtool pkg-config libevent-dev
</code></pre>

<p>In addition for this specific version I ran:</p>

<pre><code>sudo apt-get install libdb++-dev libminiupnpc-dev
</code></pre>

<p>I then checked out the source and started the compilation:</p>

<pre><code>git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
git checkout v0.8.6
cd src/
make -f makefile.unix
</code></pre>

<p>I'm only interested in running headless <code>bitcoind</code>, but I'm not sure if it was already separated form the UI at that release.</p>

<p>I get the following error:</p>

<pre><code>rpcrawtransaction.cpp:241:77:   required from here
/usr/include/boost/variant/get.hpp:178:5: error: invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE&lt;false&gt;’
 BOOST_STATIC_ASSERT_MSG(
 ^
makefile.unix:172: recipe for target 'obj/rpcrawtransaction.o' failed
make: *** [obj/rpcrawtransaction.o] Error 1
</code></pre>

<p>Interestingly 0.7, 0.6 and 0.5 do compile successfully, although they get stuck during IDB, so perhaps compilation just failed silently. I'll make a separate post for those later.</p>

<p>I suspect that I need to install some very specific versions of dependencies, but I'm not sure which and how to go about that. I haven't used Linux in years.</p>

<p>I still have the VM, so I can provide more details if needed.</p>

<p>I'm open to alternative approaches, even using a Windows VM :-) </p>

CC BY-SA 3.0
2017-07-05T17:24:32.227Z
1) [This thread](https://github.com/bitcoin/bitcoin/issues/6113) suggests unsetting BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT, or applying [this change](https://github.com/bitcoin/bitcoin/commit/8b08d9530b93c7a98e7387167ecd2cd5b0563bfb). 2) What's your boost version? PS: Neat project!
Nick ODell
CC BY-SA 3.0
2017-07-05T18:13:00.650Z
@NickODell `libboost-all-dev` version 1.58.0. I might try the gitian approach first though.
Sjors Provoost
CC BY-SA 3.0
2017-07-05T18:27:16.843Z
As for pre-0.8 versions getting stuck in IBD, you'll need to increase the number of BDB locks as described here: https://bitcoin.org/en/alert/2013-03-15-upgrade-deadline.
Pieter Wuille
CC BY-SA 3.0
2017-07-05T18:32:59.880Z
@PieterWuille thanks, I actually already did that. They get stuck at different blocks: https://gist.github.com/Sjors/70f14baf1f834f3547bf35553faff610#v072

I might try gitian for those too, because I'm pretty sure the dependencies are a mess on default modern Ubuntu.
Sjors Provoost
CC BY-SA 3.0
2017-07-05T21:21:35.690Z
You're using a too recent OpenSSL version which requires strict DER signatures, which only became mandatory in Bitcoin after BIP66. You'll need the patch here: https://github.com/bitcoin/bitcoin/pull/5634/files in order to use the pre-BIP66 chain with new OpenSSL.
Pieter Wuille
CC BY-SA 3.0
2017-07-22T10:53:14.490Z
P.S. so it took 184 hours to sync. Here's the chart: https://medium.com/@provoost/historical-bitcoin-core-client-performance-c5f16e1f8ccb
Sjors Provoost
CC BY-SA 4.0
2020-07-18T02:39:02.023Z
do you know the dependencies that you needed to build 0.8.6 and the other pre-0.8 versions? Thanks for any insight!
LeanMan
CC BY-SA 4.0
2020-07-18T02:50:37.633Z
Just to clarify, the versions of the dependencies you used. (e.g., you already mentioned 1.58.0 boost - what about the others? Thanks!)
LeanMan
<bitcoind><compiling>
How do I compile Core 0.8.6 on Ubuntu (EC2)?
Sjors Provoost
# How do I compile Core 0.8.6 on Ubuntu (EC2)?

(Asked by: username_0 on 2017-07-05)

I'm trying to compile v0.8.6 of the core client from source, in order to compare IDB (Initial Blockchain Download) performance between versions.
I created a fresh Ubuntu Xenial 16.04 machine on Amazon EC2. I then ran the following commands (which were sufficient for version 0.9.3 and up):
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential autoconf libboost-all-dev \
                     libssl-dev libtool pkg-config libevent-dev

In addition for this specific version I ran:
sudo apt-get install libdb++-dev libminiupnpc-dev

I then checked out the source and started the compilation:
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
git checkout v0.8.6
cd src/
make -f makefile.unix

I'm only interested in running headless bitcoind, but I'm not sure if it was already separated form the UI at that release.
I get the following error:
rpcrawtransaction.cpp:241:77:   required from here
/usr/include/boost/variant/get.hpp:178:5: error: invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE’
 BOOST_STATIC_ASSERT_MSG(
 ^
makefile.unix:172: recipe for target 'obj/rpcrawtransaction.o' failed
make: *** [obj/rpcrawtransaction.o] Error 1

Interestingly 0.7, 0.6 and 0.5 do compile successfully, although they get stuck during IDB, so perhaps compilation just failed silently. I'll make a separate post for those later.
I suspect that I need to install some very specific versions of dependencies, but I'm not sure which and how to go about that. I haven't used Linux in years.
I still have the VM, so I can provide more details if needed.
I'm open to alternative approaches, even using a Windows VM :-)

**Tags:** bitcoind, compiling

> **Comments:**
> **username_1**: 1) [This thread](https://github.com/bitcoin/bitcoin/issues/6113) suggests unsetting BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT, or applying [this change](https://github.com/bitcoin/bitcoin/commit/8b08d9530b93c7a98e7387167ecd2cd5b0563bfb). 2) What's your boost version? PS: Neat project!  
> **username_0**: @NickODell `libboost-all-dev` version 1.58.0. I might try the gitian approach first though.  
> **username_2**: As for pre-0.8 versions getting stuck in IBD, you'll need to increase the number of BDB locks as described here: https://bitcoin.org/en/alert/2013-03-15-upgrade-deadline.  
> **username_0**: @PieterWuille thanks, I actually already did that. They get stuck at different blocks: https://gist.github.com/Sjors/70f14baf1f834f3547bf35553faff610#v072  I might try gitian for those too, because I'm pretty sure the dependencies are a mess on default modern Ubuntu.  
> **username_2**: You're using a too recent OpenSSL version which requires strict DER signatures, which only became mandatory in Bitcoin after BIP66. You'll need the patch here: https://github.com/bitcoin/bitcoin/pull/5634/files in order to use the pre-BIP66 chain with new OpenSSL.  
> **username_0**: P.S. so it took 184 hours to sync. Here's the chart: https://medium.com/@provoost/historical-bitcoin-core-client-performance-c5f16e1f8ccb  
> **username_3**: do you know the dependencies that you needed to build 0.8.6 and the other pre-0.8 versions? Thanks for any insight!  
> **username_3**: Just to clarify, the versions of the dependencies you used. (e.g., you already mentioned 1.58.0 boost - what about the others? Thanks!)  

---

## 2 answers

### Answer by username_0 on 2017-07-06. Score: 1 | Accepted answer

username_1 pointed me to the solution:
Edit rpcrawtransaction.cpp and change:
const CScriptID& hash = boost::get(address);

To:
const CScriptID& hash = boost::get(address);

This was sufficient to get it to compile.
In addition I applied the OpenSSL patch username_2 pointed out.
You have to do this manually because depends/packages/openssl.mk no longer exists, and the function name and signature has changed. Simply open src/key.cpp and replace everything inside the CKey::Verify function brackets with this new version.
More than 210,000 blocks synced so far, so I'm assuming this worked.


---

### Answer by username_4 on 2017-07-05. Score: 2

You can use the gitian build system. Instructions for building 0.8.x with gitian are available here: <https://github.com/bitcoin/bitcoin/tree/0.8/contrib/gitian-descriptors> and here: <https://github.com/bitcoin/bitcoin/blob/0.8/doc/release-process.md>. Using gitian should get you exactly the same binaries as those that were released.

> **Comments:**
> **username_0**: Thanks, that's a great opportunity to learn about Gitian. I'll mark your answer as Accepted if that works out.  
> **username_0**: Unfortunately this won't work out of the box on EC2 (T2): `sudo /usr/sbin/kvm-ok INFO: Your CPU does not support KVM extensions KVM acceleration can NOT be used`  It looks like I would have to use something fancy like [Ravello](https://www.ravellosystems.com/blog/run-nested-kvm-on-aws-google/), or am I missing something?  
> **username_4**: IIRC EC2 itself is a VM, so you can't use KVM in it. However, you should be able to use LXC and there are instructions for that at the bottom of the first link I posted (ignore the virtualbox stuff). You will need to do the `make-base-vm` commands with the `--lxc` option too.  

---

