Bitcoin Forum
May 09, 2024, 05:43:14 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: 5 BTC Bounty for Windows and Linux Gitian build instructions  (Read 4975 times)
TwistedPair (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0



View Profile
September 08, 2011, 02:57:13 AM
 #1

I'm running Windows XP and Ubuntu on VMWare with a clean install. I'll pay 5 BTC to whoever enables me to build a working bitcoin and bitcoind binaries from latest 0.4 source.

I need a complete step-by-step guide for what I need to download, what commands I need to run, etc. This includes installing dev libraries, ruby, gitian, setting up qemu 64 and 32 bit VMs etc.

I was looking for something like this https://bitcointalk.org/index.php?topic=5851.msg86700#msg86700

If you can only do Windows or Ubuntu, then you'll get 2.5 BTC for your efforts.

Thanks.

TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715233394
Hero Member
*
Offline Offline

Posts: 1715233394

View Profile Personal Message (Offline)

Ignore
1715233394
Reply with quote  #2

1715233394
Report to moderator
makomk
Hero Member
*****
Offline Offline

Activity: 686
Merit: 564


View Profile
September 08, 2011, 01:15:24 PM
Last edit: September 08, 2011, 02:42:56 PM by makomk
 #2

In theory this is quite easy, but you need to run it under 64-bit Ubuntu - even Windows binaries have to be built in Ubuntu - and some bits have to be run as root. (There's no trivial way to do just a 32-bit build.) Oh, and it'll probably be a bit slow if you run it under VMWare.

First install the prerequisites:
Code:
sudo apt-get install python-vm-builder qemu-kvm apt-cacher git-core ruby
sudo service apt-cacher start
You'll of course need to enter your login password when prompted.

Now download gitian and bitcoin and create your VM:
Code:
git clone https://github.com/devrandom/gitian-builder
git clone https://github.com/bitcoin/bitcoin
cd gitian-builder
bin/make-base-vm -a i386
bin/make-base-vm -a amd64
You'll again need to enter your login password so that make-base-vm can run some commands as root.

Edit bitcoin/contrib/gitian.yml to replace the -f in "unzip -f ../wxWidgets-2.9.2-x64-gitian.zip" with -o or the 64-bit Bitcoin build will fail later.

Get the other bits you need:
Code:
mkdir inputs
cd inputs
wget http://sourceforge.net/projects/wxwindows/files/2.9.2/wxWidgets-2.9.2.tar.bz2
wget 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.tar.gz' -O miniupnpc-1.6.tar.gz
cd ..

Now you can actually try building Linux binaries:
Code:
bin/gbuild ../bitcoin/contrib/wxwidgets.yml
cp build/out/wxWidgets-2.9.2-x32-gitian.zip build/out/wxWidgets-2.9.2-x64-gitian.zip inputs
bin/gbuild ../bitcoin/contrib/gitian.yml -c bitcoin=HEAD
This will take a while and use several gigabytes of disk space, but at the end you should have 32 and 64-bit Bitcoin binaries in build/out/bin/32 and build/out/bin/64. Bear in mind that every gbuild run seems to empty build/out, so if you want to keep those binaries you'll need to copy them somewhere. You can also safely delete target-lucid-amd64.qcow2 and target-lucid-i386.qcow2 once it's done to free up some space.

To build Windows binaries:
You need to do all the same preparation steps if you haven't done so already, plus you need to download some extra source packages. You also need to edit bitcoin/contrib/gitian-win32.yml - find the line that reads:
Code:
sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw
Change it to:
Code:
sed 's|wingenminiupnpcstrings $< $@|sh updateminiupnpcstrings.sh|' -i Makefile.mingw
Now run these commands:
Code:
cd inputs
wget http://sourceforge.net/projects/boost/files/boost/1.47.0/boost_1_47_0.tar.bz2
wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
cd ..
bin/gbuild ../bitcoin/contrib/wxwidgets-win32.yml
cp build/out/wxwidgets-win32-2.9.2-gitian.zip inputs/
bin/gbuild ../bitcoin/contrib/boost-win32.yml
cp build/out/boost-win32-1.47.0-gitian.zip inputs/
bin/gbuild ../bitcoin/contrib/gitian-win32.yml -c bitcoin=HEAD
You should get a bitcoin.exe and an installer bitcoin-0.4.00-win32-setup.exe in build/out/, plus a bitcoind.exe in build/out/daemon/

Issues you're likely to encounter:

ssh: connect to host localhost port 2223: Connection refused
This means that qemu has failed to start. Try editing libexec/start-target and changing "kvm" to "qemu". If that fails, look in var/target.log for any error messages.

Connection timed out during banner exchange
This means your qemu VM didn't manage to boot far enough for ssh to be running. There appears to be a lurking bug in some python-vm-builder versions that causes bootloader installation to fail.

cp: cannot open `base-lucid-i386.qcow2' for reading: Permission denied
Code:
sudo chmod 644 base-lucid-i386.qcow2

There may be more issues I haven't spotted; I'm actually running this from Gentoo rather than Ubuntu because I'm doing it for my own purposes rather than the bounty specifically, so some bits are cribbed from the README. (Notes for Gentoo users: emerge qemu-kvm ruby debootstrap multipath-tools apt-cacher-ng dev-python/cheetah, manually download and install vm-builder-0.12.4+bzr469.)  Let me know how you get on!

(Edited with hopefully-working build instructions for Windows binaries.)

Quad XC6SLX150 Board: 860 MHash/s or so.
SIGS ABOUT BUTTERFLY LABS ARE PAID ADS
TwistedPair (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0



View Profile
September 08, 2011, 10:53:43 PM
 #3

Nice. Thanks. I'll give your instructions a try when I get a moment. Please PM me your btc address Wink
Matt Corallo
Hero Member
*****
expert
Offline Offline

Activity: 755
Merit: 515


View Profile
September 09, 2011, 03:51:34 PM
Last edit: September 09, 2011, 04:43:24 PM by Matt Corallo
 #4

- and some bits have to be run as root. (There's no trivial way to do just a 32-bit build.)
You could easily remove the - "amd64" line in the gitian config file, but that means your output wont be verifyable via gitian's automatic verification.
Oh, and it'll probably be a bit slow if you run it under VMWare.
Very much an understatement:
gitian launches a VM of Ubuntu for you.  Because running a VM in a VM can't use hardware virtualization and qemu's software virtualization is very, very slow building Bitcoin in gitian in a VM is going to be very slow.

Edit bitcoin/contrib/gitian.yml to replace the -f in "unzip -f ../wxWidgets-2.9.2-x64-gitian.zip" with -o or the 64-bit Bitcoin build will fail later.
My bad, apparently I cant read a man page...Ill get it fixed in a minute.

To build Windows binaries:
You need to do all the same preparation steps if you haven't done so already, plus you need to download some extra source packages. You also need to edit bitcoin/contrib/gitian-win32.yml - find the line that reads:
Code:
sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw
Change it to:
Code:
sed 's|wingenminiupnpcstrings $< $@|sh updateminiupnpcstrings.sh|' -i Makefile.mingw
I'm not sure there are no adverse effects here (updateminiupnpcstrings.sh will define several constants to indicate the OS is Linux, not Windows whereas the intention here is to compile the windows version and run it as it runs fine in wine after that sed, I'm too lazy to read through miniupnpc source to see what it effects plus it might change in a future version).  I think the is solution is to add wine1.3 to the list of packages to install (I need to test it, but I think it should work, Ill test it in the next couple hours).
EDIT: Should be wine, not wine1.3

ssh: connect to host localhost port 2223: Connection refused
This means that qemu has failed to start. Try editing libexec/start-target and changing "kvm" to "qemu". If that fails, look in var/target.log for any error messages.
This won't work inside a VM of ubuntu as kvm requires hardware virtualization whereas qemu will fallback on software virtualization (IIRC).


Sorry for the mistakes in the gitian descriptors, I really cant test right for some reason...

EDIT: See https://github.com/bitcoin/bitcoin/pull/508

Bitcoin Core, rust-lightning, http://bitcoinfibre.org etc.
PGP ID: 07DF 3E57 A548 CCFB 7530  7091 89BB B866 3E2E65CE
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!