Bitcoin Forum
November 08, 2024, 08:21:07 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Automatic] Building windows bitcoin client from sources  (Read 4194 times)
pB11 (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 2


View Profile
July 14, 2011, 11:20:02 AM
Last edit: July 17, 2011, 12:42:36 AM by pB11
Merited by xandry (2)
 #1

Here is the script to grab and compile latest sources.
Only mingw is pre-built, everything else is built from scratch.
  • Fully automatic!
  • No prerequisites.
  • Just create .bat and run it.
  • It downloads and builds everything in current folder.
You can delete C:\msysgit afterwards.
Upnp not included.
Tested on Windows 2008 R2 and Windows 7, 32 and 64 bit.

Code:
if exist msysGit.exe goto unpack
echo Downloading msysgit
echo Set x=CreateObject("Microsoft.XMLHTTP"):x.Open "GET","http://msysgit.googlecode.com/files/msysGit-fullinstall-1.7.6-preview20110708.exe",0:x.Send() >d.vbs
echo Set s=CreateObject("ADODB.Stream"):s.Type=1:s.Open():s.Write(x.responseBody):s.SaveToFile "msysGit.exe",2 >>d.vbs
cscript /nologo d.vbs
if not exist msysGit.exe goto e1
:unpack
msysGit.exe -y -nr
xcopy /E C:\msysgit
echo Compiling GIT
msysgit\bin\bash.exe --login echo DONE

:setpath
for /F "delims=" %%I in ("%~dp0") do set install_root=%%~fI
set PATH=%install_root%\msysgit\bin;%install_root%\msysgit\mingw\bin;%PATH%

:wxWidgets
svn co http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets
cd wxWidgets\build\msw
bash -c 'mingw32-make -f makefile.gcc BUILD=release'
cd %install_root%

:Boost
svn co http://svn.boost.org/svn/boost/trunk boost
cd boost
call bootstrap.bat mingw
bjam.exe toolset=gcc address-model=32 variant=release link=static threading=multi runtime-link=shared --build-type=complete stage
cd %install_root%

:OpenSSL
curl http://openssl.org/source/openssl-1.0.0d.tar.gz --O openssl-1.0.0d.tar.gz
md5sum openssl-1.0.0d.tar.gz >check.md5
grep 40b6ea380cc8a5bf9734c2f8bf7e701e check.md5
if not %errorlevel%==0 goto e1
tar xzf openssl-1.0.0d.tar.gz
cd openssl-1.0.0d
bash -i -c './config;make'
perl util/mkdef.pl 32 libeay enable-static-engine > libeay32.def
dllwrap --dllname libeay32.dll --output-lib libeay32.a --def libeay32.def libcrypto.a -lws2_32 -lgdi32
cd %install_root%

:BerkeleyDB
if exist db-4.7.25.NC goto BerkeleyDBUnpacked
curl http://download.oracle.com/berkeley-db/db-4.7.25.NC.zip --O db-4.7.25.NC.zip
unzip db-4.7.25.NC.zip
:BerkeleyDBUnpacked
cd db-4.7.25.NC/build_unix
bash -i -c '../dist/configure --enable-mingw --enable-cxx;make'
cd %install_root%

:Bitcoin
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin/src
bash -i -c 'make -f makefile.mingw INCLUDEPATHS="-I../../boost -I../../db-4.7.25.NC/build_unix -I../../openssl-1.0.0d/include -I../../wxWidgets/lib/gcc_lib/mswu -I../../wxWidgets/include -DBOOST_THREAD_USE_LIB -UUSE_UPNP" LIBPATHS="-L../../boost/stage/lib -L../../db-4.7.25.NC/build_unix -L../../openssl-1.0.0d -L../../wxWidgets/lib/gcc_lib" WXLIBS="-lwxmsw29u_html -lwxmsw29u_core -lwxmsw29u_adv -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib" LIBS="-lboost_system-mgw44-mt-1_48 -lboost_filesystem-mgw44-mt-1_48 -lboost_program_options-mgw44-mt-1_48 -lboost_thread-mgw44-mt-1_48 -ldb_cxx -lssl -lcrypto -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi"'
strip bitcoin.exe
copy ..\..\msysgit\mingw\bin\mingwm10.dll
exit

:e1
echo failed!
Thanks for Windows Build Instructions:http://forum.bitcoin.org/index.php?topic=5851.msg86700#msg86700
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1104


View Profile
July 14, 2011, 12:19:01 PM
 #2

I would suggest breaking it into 2 batch files.  The first one would be to create the environment and the second would just compile the client.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
pB11 (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 2


View Profile
July 14, 2011, 02:06:30 PM
Last edit: July 14, 2011, 03:02:53 PM by pB11
 #3

I would suggest breaking it into 2 batch files.  The first one would be to create the environment and the second would just compile the client.
Yeah, i bet everyone who will use it for second time will do it anyway.
Relevant lines for [pulling updates and] re-building bitcoin:
Code:
for /F "delims=" %%I in ("%~dp0") do set install_root=%%~fI
set PATH=%install_root%\msysgit\bin;%install_root%\msysgit\mingw\bin;%PATH%

cd bitcoin
::git pull
cd src
bash -i -c 'make -f makefile.mingw INCLUDEPATHS="-I../../boost -I../../db-4.7.25.NC/build_unix -I../../openssl-1.0.0d/include -I../../wxWidgets/lib/gcc_lib/mswu -I../../wxWidgets/include -DBOOST_THREAD_USE_LIB -UUSE_UPNP" LIBPATHS="-L../../boost/stage/lib -L../../db-4.7.25.NC/build_unix -L../../openssl-1.0.0d -L../../wxWidgets/lib/gcc_lib" WXLIBS="-lwxmsw29u_html -lwxmsw29u_core -lwxmsw29u_adv -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib" LIBS="-lboost_system-mgw44-mt-1_48 -lboost_filesystem-mgw44-mt-1_48 -lboost_program_options-mgw44-mt-1_48 -lboost_thread-mgw44-mt-1_48 -ldb_cxx -lssl -lcrypto -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi"'
strip bitcoin.exe
P.S. Edit: uncomment 'git pull' if you want to update source tree
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1104


View Profile
July 14, 2011, 02:42:10 PM
 #4

Relevant lines for pulling updates and re-building bitcoin:
Code:
for /F "delims=" %%I in ("%~dp0") do set install_root=%%~fI
set PATH=%install_root%\msysgit\bin;%install_root%\msysgit\mingw\bin;%PATH%

cd bitcoin
git pull
cd src
bash -i -c 'make -f makefile.mingw INCLUDEPATHS="-I../../boost -I../../db-4.7.25.NC/build_unix -I../../openssl-1.0.0d/include -I../../wxWidgets/lib/gcc_lib/mswu -I../../wxWidgets/include -DBOOST_THREAD_USE_LIB -UUSE_UPNP" LIBPATHS="-L../../boost/stage/lib -L../../db-4.7.25.NC/build_unix -L../../openssl-1.0.0d -L../../wxWidgets/lib/gcc_lib" WXLIBS="-lwxmsw29u_html -lwxmsw29u_core -lwxmsw29u_adv -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib" LIBS="-lboost_system-mgw44-mt-1_48 -lboost_filesystem-mgw44-mt-1_48 -lboost_program_options-mgw44-mt-1_48 -lboost_thread-mgw44-mt-1_48 -ldb_cxx -lssl -lcrypto -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi"'
strip bitcoin.exe

I would have gone with just the last 3 lines.  Assuming the person is modifying the client, you don't want to pull the source when doing a recompile.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
dacoinminster
Legendary
*
expert
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
August 15, 2011, 09:38:40 PM
 #5

My antivirus software thinks this batch file is making a trojan downloader Undecided

Gonna have to do it the slow way: http://forum.bitcoin.org/index.php?topic=5851.msg86700#msg86700

N.Z.
Sr. Member
****
Offline Offline

Activity: 427
Merit: 250



View Profile
August 15, 2011, 11:00:44 PM
 #6

dacoinminster, it is a joke, right? If not, you have the source before your eyes! Throw away your antivirus!
dacoinminster
Legendary
*
expert
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
August 16, 2011, 12:49:18 AM
 #7

dacoinminster, it is a joke, right? If not, you have the source before your eyes! Throw away your antivirus!

Sadly, this is not a joke. The antivirus cannot be disabled on this PC.

I'd appreciate any help I can get with the problems I am having compiling. Read about it here: https://bitcointalk.org/index.php?topic=5851.msg458581#msg458581

phelix
Legendary
*
Offline Offline

Activity: 1708
Merit: 1020



View Profile
July 17, 2013, 08:50:14 AM
 #8

similar approach:
https://bitcointalk.org/index.php?topic=252931 [ANN] EasyWinBuilder - The Easy Way to Build Bitcoin on Windows
mfread
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
March 10, 2014, 07:14:21 AM
 #9

I realise this post is some 120 days since the last.

Has there been any improvement on this (or other) process?

I've scoured the net and this is all I can find at present:

1) I don't want to use coingen.io because you have little control over what is built - you still have to take the source and compile it afterwards.

2) I don't want to use the services of razorcoin either as it seems very expensive (try 1 to 3 BTC !!) for anything more than a very bare bones coin build.

I'm relatively new to crypt currency. I have been mining on Windows and Linux for a few months (CPU, GPU, ASIC, ANT, solo, pool, p2pool, cgminer, bfminer).

I'm looking for either:

a) a one-stop shop/service that can build wallets (Win, Linux and perhaps Mac) and perhaps other components (like a BlockChain scanner etc).

b) a developer who is willing to assist/teach the process.

c) simple instructions to setup & build altcoins (video preferred) on a Win7 x64 platform.

Either reply here or PM me.

Many thanks,
Mark


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!