windows-build.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. ######################################################################################
  2. # #
  3. # Native WIN32 setup and build instructions (on mingw32/Windows): #
  4. # #
  5. ######################################################################################
  6. **************************************************************************************
  7. * Introduction *
  8. **************************************************************************************
  9. The following instructions have been tested on both Windows 7 and Windows XP.
  10. Most of what is described below (copying files, downloading files, etc.) can be done
  11. directly in the MinGW MSYS shell; these instructions do not do so because package
  12. versions and links change over time. The best way is to use your browser, go to the
  13. links directly, and see for yourself which versions you want to install.
  14. If you think that this documentation was helpful and you wish to donate, you can
  15. do so at the following address. 12KaKtrK52iQjPdtsJq7fJ7smC32tXWbWr
  16. **************************************************************************************
  17. * A tip that might help you along the way *
  18. **************************************************************************************
  19. Enable "QuickEdit Mode" in your Command Prompt Window or MinGW Command Prompt
  20. Window (No need to go into the context menu to choose edit-mark/copy/paste):
  21. Right-click on the title bar and click Properties. Under the Options tab, check
  22. the box for "QuickEdit Mode". Alternately, if you want this change to be
  23. permanent on all of your Command Prompt Windows; you can click Defaults instead
  24. of Properties as described above. Now you can drag and select text you want to
  25. copy, right-click to copy the text to the clipboard and right-click once again to
  26. paste it at the desired location. You could for example, copy some text from this
  27. document to the clipboard and right click in your Command Prompt Window to paste
  28. what you copied.
  29. **************************************************************************************
  30. * Install mingw32 *
  31. **************************************************************************************
  32. Go to this url ==> http://www.mingw.org/wiki/Getting_Started
  33. Click the link that says "Download and run the latest mingw-get-inst version."
  34. Download and run the latest file. Install MinGW in the default directory.
  35. (I downloaded the one labeled "mingw-get-inst-20111118" - note that this could
  36. be a different version later.)
  37. Make sure to check the option for "Download latest repository catalogs".
  38. I just selected all the check boxes (excluding "Fortran Compiler") so that everything
  39. was installed.
  40. **************************************************************************************
  41. * Create mstcpip.h *
  42. **************************************************************************************
  43. Open notepad and copy the following into it. Save it as "\MinGW\include\mstcpip.h".
  44. Make sure it does not have the ".txt" extension (If it does then rename it).
  45. struct tcp_keepalive
  46. {
  47. u_long onoff;
  48. u_long keepalivetime;
  49. u_long keepaliveinterval;
  50. };
  51. #ifndef USE_WS_PREFIX
  52. #define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR, 4)
  53. #else
  54. #define WS_SIO_KEEPALIVE_VALS _WSAIOW(WS_IOC_VENDOR, 4)
  55. #endif
  56. **************************************************************************************
  57. * Run the MSYS shell for the first time to create your user directory *
  58. **************************************************************************************
  59. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  60. This will create your user directory for you.
  61. **************************************************************************************
  62. * Install libpdcurses *
  63. **************************************************************************************
  64. Type the lines below to install libpdcurses.
  65. mingw-get install mingw32-libpdcurses
  66. mingw-get install mingw32-pdcurses
  67. Ctrl-D or typing "logout" and pressing the enter key should get you out of the
  68. window.
  69. **************************************************************************************
  70. * Copy BFGMiner source to your MSYS working directory *
  71. **************************************************************************************
  72. Copy BFGMiner source code directory into:
  73. \MinGW\msys\1.0\home\(folder with your user name)
  74. **************************************************************************************
  75. * Install GTK-WIN, required for Pkg-config in the next step *
  76. **************************************************************************************
  77. Go to this url ==> http://sourceforge.net/projects/gtk-win/
  78. Download the file.
  79. After you have downloaded the file Double click/run it and this will install GTK+
  80. I chose all the selection boxes when I installed.
  81. Copy libglib-2.0-0.dll and intl.dll from \Program Files (x86)\gtk2-runtime\bin to
  82. \MinGW\bin
  83. Note: If you are on a 32 bit version of windows "Program Files (x86)" will be
  84. "Program Files".
  85. **************************************************************************************
  86. * Install pkg-config *
  87. **************************************************************************************
  88. Go to this url ==> http://www.gtk.org/download/win32.php
  89. Scroll down to where it shows pkg-cfg.
  90. Download the file from the tool link. Extract "pkg-config.exe" from bin and place in
  91. your \MinGW\bin directory.
  92. Download the file from the "Dev" link. Extract "pkg.m4" from share\aclocal and place
  93. in your \MingW\share\aclocal directory.
  94. **************************************************************************************
  95. * Install libcurl *
  96. **************************************************************************************
  97. Go to this url ==> http://curl.haxx.se/download.html#Win32
  98. At the section where it says "Win32 - Generic", Click on the link that indicates
  99. Win32 2000.XP 7.24.0 libcurl SSL and download it.
  100. The one I downloaded may not be current for you. Choose the latest.
  101. Extract the files that are in the zip (bin, include, and lib) to their respective
  102. locations in MinGW (\MinGW\bin, \MinGW\include, and \MinGW\lib).
  103. Edit the file \MinGW\lib\pkgconfig\libcurl.pc and change "-lcurl" to
  104. "-lcurl -lcurldll".
  105. Ref. http://old.nabble.com/gcc-working-with-libcurl-td20506927.html
  106. **************************************************************************************
  107. * Build bfgminer.exe *
  108. **************************************************************************************
  109. Run the MinGW MSYS shell
  110. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  111. Change the working directory to your BFGMiner project folder.
  112. Example: cd bfgminer-2.1.2 [Enter Key] if you are unsure then type "ls -la"
  113. Another way is to type "cd cg" and then press the tab key; It will auto fill.
  114. Type the lines below one at a time. Look for problems after each one before going on
  115. to the next.
  116. adl.sh (optional - see below)
  117. autoreconf -fvi
  118. CFLAGS="-O2 -msse2" ./configure (additional config options, see below)
  119. make
  120. **************************************************************************************
  121. * Copy files to a build directory/folder *
  122. **************************************************************************************
  123. Make a directory and copy the following files into it. This will be your BFGMiner
  124. Folder that you use for mining. Remember the .cl filenames could change on later
  125. releases. If you installed a different version of libcurl then some of those dll's
  126. may be different as well.
  127. bfgminer.exe from \MinGW\msys\1.0\home\(username)\bfgminer-x.x.x
  128. *.cl from \MinGW\msys\1.0\home\(username)\bfgminer-x.x.x
  129. README from \MinGW\msys\1.0\home\(username)\bfgminer-x.x.x
  130. libcurl.dll from \MinGW\bin
  131. libeay32.dll from \MinGW\bin
  132. libidn-11.dll from \MinGW\bin
  133. libssl32.dll from \MinGW\bin
  134. libpdcurses.dll from \MinGW\bin
  135. pthreadGC2.dll from \MinGW\bin
  136. **************************************************************************************
  137. * Optional - Install Git into MinGW/MSYS *
  138. **************************************************************************************
  139. Go to this url ==> http://code.google.com/p/msysgit/
  140. Click on the Downloads tab.
  141. Download the latest "Portable" git archive.
  142. Extract the git*.exe files from the bin folder and put them into \MinGW\bin.
  143. Extract the share\git-core folder and place it into \MinGW\share.
  144. To test if it is working, open a MinGW shell and type the following:
  145. git config -–global core.autocrlf false (note: one time run only)
  146. git clone git://github.com/luke-jr/bfgminer.git
  147. If you simply just want to update the source after you have already cloned, type:
  148. git pull git://github.com/luke-jr/bfgminer.git
  149. Now you can get the latest source directly from github.
  150. **************************************************************************************
  151. * Some ./configure options *
  152. **************************************************************************************
  153. --disable-opencl Build without support for OpenCL (default enabled)
  154. --disable-adl Build without ADL monitoring (default enabled)
  155. --enable-bitforce Compile support for BitForce FPGAs(default disabled)
  156. --enable-icarus Compile support for Icarus Board(default disabled)
  157. ######################################################################################
  158. # #
  159. # Native WIN32 setup and build instructions (on mingw32/Windows) complete #
  160. # #
  161. ######################################################################################
  162. Addendum:
  163. Ztex support requires libusb support. The most comprehensive support is
  164. currently available from the libusbx project here:
  165. http://libusbx.org/