windows-build.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 AMD APP SDK, latest version (only if you want GPU mining) *
  76. **************************************************************************************
  77. Note: You do not need to install the AMD APP SDK if you are only using Nvidia GPU's
  78. Go to this url for the latest AMD APP SDK:
  79. http://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspx
  80. Go to this url for legacy AMD APP SDK's:
  81. http://developer.amd.com/sdks/AMDAPPSDK/downloads/pages/AMDAPPSDKDownloadArchive.aspx
  82. Download and install whichever version you like best.
  83. Copy the folders in \Program Files (x86)\AMD APP\include to \MinGW\include
  84. Copy \Program Files (x86)\AMD APP\lib\x86\libOpenCL.a to \MinGW\lib
  85. Note: If you are on a 32 bit version of windows "Program Files (x86)" will be
  86. "Program Files".
  87. Note2: If you update your APP SDK later you might want to recopy the above files
  88. **************************************************************************************
  89. * Install GTK-WIN, required for Pkg-config in the next step *
  90. **************************************************************************************
  91. Go to this url ==> http://sourceforge.net/projects/gtk-win/
  92. Download the file.
  93. After you have downloaded the file Double click/run it and this will install GTK+
  94. I chose all the selection boxes when I installed.
  95. Copy libglib-2.0-0.dll and intl.dll from \Program Files (x86)\gtk2-runtime\bin to
  96. \MinGW\bin
  97. Note: If you are on a 32 bit version of windows "Program Files (x86)" will be
  98. "Program Files".
  99. **************************************************************************************
  100. * Install pkg-config *
  101. **************************************************************************************
  102. Go to this url ==> http://www.gtk.org/download/win32.php
  103. Scroll down to where it shows pkg-cfg.
  104. Download the file from the tool link. Extract "pkg-config.exe" from bin and place in
  105. your \MinGW\bin directory.
  106. Download the file from the "Dev" link. Extract "pkg.m4" from share\aclocal and place
  107. in your \MingW\share\aclocal directory.
  108. **************************************************************************************
  109. * Install libcurl *
  110. **************************************************************************************
  111. Go to this url ==> http://curl.haxx.se/download.html#Win32
  112. At the section where it says "Win32 - Generic", Click on the link that indicates
  113. Win32 2000.XP 7.24.0 libcurl SSL and download it.
  114. The one I downloaded may not be current for you. Choose the latest.
  115. Extract the files that are in the zip (bin, include, and lib) to their respective
  116. locations in MinGW (\MinGW\bin, \MinGW\include, and \MinGW\lib).
  117. Edit the file \MinGW\lib\pkgconfig\libcurl.pc and change "-lcurl" to
  118. "-lcurl -lcurldll".
  119. Ref. http://old.nabble.com/gcc-working-with-libcurl-td20506927.html
  120. **************************************************************************************
  121. * Build bfgminer.exe *
  122. **************************************************************************************
  123. Run the MinGW MSYS shell
  124. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  125. Change the working directory to your BFGMiner project folder.
  126. Example: cd bfgminer-2.1.2 [Enter Key] if you are unsure then type "ls -la"
  127. Another way is to type "cd cg" and then press the tab key; It will auto fill.
  128. Type the lines below one at a time. Look for problems after each one before going on
  129. to the next.
  130. adl.sh (optional - see below)
  131. autoreconf -fvi
  132. CFLAGS="-O2 -msse2" ./configure (additional config options, see below)
  133. make
  134. **************************************************************************************
  135. * Copy files to a build directory/folder *
  136. **************************************************************************************
  137. Make a directory and copy the following files into it. This will be your BFGMiner
  138. Folder that you use for mining. Remember the .cl filenames could change on later
  139. releases. If you installed a different version of libcurl then some of those dll's
  140. may be different as well.
  141. bfgminer.exe from \MinGW\msys\1.0\home\(username)\bfgminer-x.x.x
  142. *.cl from \MinGW\msys\1.0\home\(username)\bfgminer-x.x.x
  143. README from \MinGW\msys\1.0\home\(username)\bfgminer-x.x.x
  144. libcurl.dll from \MinGW\bin
  145. libeay32.dll from \MinGW\bin
  146. libidn-11.dll from \MinGW\bin
  147. libssl32.dll from \MinGW\bin
  148. libpdcurses.dll from \MinGW\bin
  149. pthreadGC2.dll from \MinGW\bin
  150. **************************************************************************************
  151. * Optional - Install Git into MinGW/MSYS *
  152. **************************************************************************************
  153. Go to this url ==> http://code.google.com/p/msysgit/
  154. Click on the Downloads tab.
  155. Download the latest "Portable" git archive.
  156. Extract the git*.exe files from the bin folder and put them into \MinGW\bin.
  157. Extract the share\git-core folder and place it into \MinGW\share.
  158. To test if it is working, open a MinGW shell and type the following:
  159. git config -–global core.autocrlf false (note: one time run only)
  160. git clone git://github.com/luke-jr/bfgminer.git
  161. If you simply just want to update the source after you have already cloned, type:
  162. git pull git://github.com/luke-jr/bfgminer.git
  163. Now you can get the latest source directly from github.
  164. **************************************************************************************
  165. * Some ./configure options *
  166. **************************************************************************************
  167. --disable-opencl Build without support for OpenCL (default enabled)
  168. --disable-adl Build without ADL monitoring (default enabled)
  169. --enable-bitforce Compile support for BitForce FPGAs(default disabled)
  170. --enable-icarus Compile support for Icarus Board(default disabled)
  171. ######################################################################################
  172. # #
  173. # Native WIN32 setup and build instructions (on mingw32/Windows) complete #
  174. # #
  175. ######################################################################################
  176. Addendum:
  177. Ztex support requires libusb support. The most comprehensive support is
  178. currently available from the libusbx project here:
  179. http://libusbx.org/