windows-build.txt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. Winrar was used to do the extracting of archive files in the making of this guide.
  15. **************************************************************************************
  16. * A tip that might help you along the way *
  17. **************************************************************************************
  18. Enable "QuickEdit Mode" in your Command Prompt Window or MinGW Command Prompt
  19. Window (No need to go into the context menu to choose edit-mark/copy/paste):
  20. Right-click on the title bar and click Properties. Under the Options tab, check
  21. the box for "QuickEdit Mode". Alternately, if you want this change to be
  22. permanent on all of your Command Prompt Windows; you can click Defaults instead
  23. of Properties as described above. Now you can drag and select text you want to
  24. copy, right-click to copy the text to the clipboard and right-click once again to
  25. paste it at the desired location. You could for example, copy some text from this
  26. document to the clipboard and right click in your Command Prompt Window to paste
  27. what you copied.
  28. **************************************************************************************
  29. * Install mingw32 *
  30. **************************************************************************************
  31. Go to this url ==> http://www.mingw.org/wiki/Getting_Started
  32. Click the link that says "Download and run the latest mingw-get-inst version."
  33. Download and run the latest file. Install MinGW in the default directory.
  34. (I downloaded the one labeled "mingw-get-inst-20120426" - note that this could
  35. be a different version later.)
  36. Make sure to check the option for "Download latest repository catalogs".
  37. I just selected all the check boxes (excluding "Fortran Compiler") so that everything
  38. was installed.
  39. **************************************************************************************
  40. * Create mstcpip.h *
  41. **************************************************************************************
  42. Open notepad and copy the following into it. Save it as "\MinGW\include\mstcpip.h".
  43. Make sure it does not have the ".txt" extension (If it does then rename it).
  44. struct tcp_keepalive
  45. {
  46. u_long onoff;
  47. u_long keepalivetime;
  48. u_long keepaliveinterval;
  49. };
  50. #ifndef USE_WS_PREFIX
  51. #define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR, 4)
  52. #else
  53. #define WS_SIO_KEEPALIVE_VALS _WSAIOW(WS_IOC_VENDOR, 4)
  54. #endif
  55. **************************************************************************************
  56. * Run the MSYS shell for the first time to create your user directory *
  57. **************************************************************************************
  58. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  59. This will create your user directory for you.
  60. **************************************************************************************
  61. * OPTIONAL - Install YASM (only for if you intend to enable CPU mining) *
  62. **************************************************************************************
  63. Open a browser to http://yasm.tortall.net/Download.html
  64. Download the Win32 or Win64 exe as appropriate
  65. Copy to c:\mingw\bin and rename to yasm.exe
  66. **************************************************************************************
  67. * Install libpdcurses *
  68. **************************************************************************************
  69. Type the lines below to install libpdcurses.
  70. mingw-get install mingw32-libpdcurses
  71. mingw-get install mingw32-pdcurses
  72. Ctrl-D or typing "logout" and pressing the enter key should get you out of the
  73. window.
  74. **************************************************************************************
  75. * Install UTHash/UTList *
  76. **************************************************************************************
  77. Go to the website http://troydhanson.github.io/uthash/
  78. Download uthash-master.zip and unzip anywhere
  79. Go to the directory uthash-master/src
  80. Copy all the files to c:/mingw/include
  81. **************************************************************************************
  82. * Install GTK-WIN, required for Pkg-config in the next step *
  83. **************************************************************************************
  84. Go to this url ==> http://sourceforge.net/projects/gtk-win/
  85. Download the file.
  86. After you have downloaded the file Double click/run it and this will install GTK+
  87. I chose all the selection boxes when I installed.
  88. Copy libglib-2.0-0.dll and intl.dll from \Program Files (x86)\gtk2-runtime\bin to
  89. \MinGW\bin
  90. Note: If you are on a 32 bit version of windows "Program Files (x86)" will be
  91. "Program Files".
  92. **************************************************************************************
  93. * Install pkg-config *
  94. **************************************************************************************
  95. Go to this url ==> http://www.gtk.org/download/win32.php
  96. Scroll down to where it shows pkg-cfg.
  97. Download the file from the tool link. Extract "pkg-config.exe" from bin and place in
  98. your \MinGW\bin directory.
  99. Download the file from the "Dev" link. Extract "pkg.m4" from share\aclocal and place
  100. in your \MingW\share\aclocal directory.
  101. **************************************************************************************
  102. * Install libcurl *
  103. **************************************************************************************
  104. Go to this url ==> http://curl.haxx.se/download.html#Win32
  105. At the section where it says "Win32 - Generic", Click on the link that indicates
  106. Win32 2000.XP 7.27.0 libcurl SSL and download it.
  107. The one I downloaded may not be current for you. Choose the latest.
  108. Extract the files that are in the zip (bin, include, and lib) to their respective
  109. locations in MinGW (\MinGW\bin, \MinGW\include, and \MinGW\lib).
  110. Edit the file \MinGW\lib\pkgconfig\libcurl.pc and change "-lcurl" to
  111. "-lcurl -lcurldll".
  112. Ref. http://old.nabble.com/gcc-working-with-libcurl-td20506927.html
  113. **************************************************************************************
  114. * Install libjansson *
  115. **************************************************************************************
  116. Go to this url ==> http://www.digip.org/jansson/releases/
  117. Download the latest tar with library sources.
  118. Copy the jansson-X.X folder into your \MinGW\msys\1.0\home\
  119. Run the MinGW MSYS shell
  120. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  121. Enter jansson-X.X dir, and type
  122. ./configure --prefix=/MinGW
  123. make
  124. make check
  125. make install
  126. (Source: http://www.digip.org/jansson/doc/dev/gettingstarted.html)
  127. (Source: https://groups.google.com/forum/#!msg/jansson-users/CTPFBeZ0ZWQ/W3uuOuWZegkJ)
  128. **************************************************************************************
  129. * Optional - Install libusb if you need auto USB device detection *
  130. * Required for Ztex and X6500 *
  131. **************************************************************************************
  132. Go to this url ==> http://git.libusb.org/?p=libusb.git;a=snapshot;h=master;sf=zip
  133. save the file to your local storage. Open the file and copy the libusb* folder to
  134. \MinGW\msys\1.0\home\(your user directory/folder).
  135. Or if you do not want to download the file directly and would like to use git then
  136. Type the following from the MSYS shell in your home folder.
  137. git clone git://git.libusb.org/libusb.git
  138. Run the MinGW MSYS shell
  139. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  140. Change the working directory to your libusb project folder.
  141. Example: cd libusb-something [Enter Key] if you are unsure then type "ls -la"
  142. Another way is to type "cd libusb" and then press the tab key; It will auto fill.
  143. Type the lines below one at a time. Look for problems after each one before going on
  144. to the next.
  145. ./autogen.sh --disable-debug-log --prefix=/MinGW
  146. make
  147. make install
  148. You may now exit the MSYS shell.
  149. Ctrl-D or typing "logout" and pressing the enter key should get you out of the
  150. window.
  151. You will have to copy "libusb-1.0.dll" to your working BFGMiner binary directory.
  152. You will find "libusb-1.0.dll" in the \MinGW\bin directory/folder.
  153. Use this method if libusb does not work for you on Ztex. Once someone lets us know
  154. Libusb works instead of libusbx then we will remove the section below this line.
  155. Run the MSYS shell and change into the libusb folder as above.
  156. Type ==> make uninstall
  157. Go to this url ==> http://libusbx.org/
  158. Click on the "Downloads" tab.
  159. Click on "releases".
  160. Click on the latest version. I downloaded 1.0.14; yours may be newer.
  161. Do not download from the link that says "Looking for the latest version?".
  162. Click on "Windows"
  163. Click on the file and download it. I downloaded libusbx-1.0.12-win.7z.
  164. Extract the the following from the file and place in where directed.
  165. Copy libusb.h from include\libusbx-1.0 to \MinGW\include\libusb-1.0\libusb.h
  166. Copy contents of MinGW32\static \MinGW\lib
  167. Copy contents of MinGW32\dll to \MinGW\lib
  168. NOTE: You will have to copy "libusb-1.0.dll" to your working BFGMiner binary directory.
  169. **************************************************************************************
  170. * REQUIRED - Install Git into MinGW/MSYS *
  171. **************************************************************************************
  172. Go to this url ==> http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git
  173. Download and install the latest full installer
  174. In Windows Explorer, go to c:\MinGW\msys\1.0\home\<username>
  175. Create a text file named profile.txt with one of the following lines (leave off the win??> part)
  176. win86> PATH=$PATH:/c/Program\ Files/Git/bin
  177. win64> PATH=$PATH:/c/Program\ Files\ \(x86\)/Git/bin
  178. Save the file, open a MSYS Shell, and enter the following commands
  179. mv profile.txt .profile
  180. then close ALL MSYS Shell windows currently open
  181. Open a new MSYS Shell and enter the following commands
  182. git clone git://github.com/luke-jr/bfgminer.git
  183. If you just want to update the source after you have already cloned, type:
  184. cd bfgminer
  185. git fetch
  186. Now you can get the latest source directly from github.
  187. **************************************************************************************
  188. * Build bfgminer.exe *
  189. **************************************************************************************
  190. Run the MinGW MSYS shell
  191. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  192. Change the working directory to your BFGMiner project folder.
  193. Example: cd bfgminer-2.7.1 [Enter Key] if you are unsure then type "ls -la"
  194. Another way is to type "cd bfg" and then press the tab key; It will auto fill.
  195. Type the lines below one at a time. Look for problems after each one before going on
  196. to the next.
  197. ./autogen.sh
  198. CFLAGS="-O2 -msse2" ./configure (additional config options, see below)
  199. make
  200. strip bfgminer.exe <== only do this if you are not compiling for debugging
  201. **************************************************************************************
  202. * Some ./configure options *
  203. **************************************************************************************
  204. --enable-cpumining Build with cpu mining support(default disabled)
  205. --disable-opencl Build without support for OpenCL (default enabled)
  206. --disable-adl Build without ADL monitoring (default enabled)
  207. --disable-bitforce Compile support for BitForce (default enabled)
  208. --disable-icarus Compile support for Icarus (default enabled)
  209. --disable-modminer Compile support for ModMiner (default enabled)
  210. --disable-x6500 Compile support for X6500 (default enabled)
  211. --disable-ztex Compile support for Ztex (default if libusb)
  212. --enable-scrypt Compile support for scrypt mining (default disabled)
  213. --without-curses Compile support for curses TUI (default enabled)
  214. --without-libudev Autodetect FPGAs using libudev (default enabled)
  215. **************************************************************************************
  216. * Copy files to a build directory/folder *
  217. **************************************************************************************
  218. Make a directory and copy the following files into it. This will be your BFGMiner
  219. Folder that you use for mining. Remember the .cl filenames could change on later
  220. releases. If you installed a different version of libcurl then some of those dll's
  221. may be different as well.
  222. bfgminer.exe from \MinGW\msys\1.0\home\(username)\bfgminer
  223. *.cl from \MinGW\msys\1.0\home\(username)\bfgminer
  224. README from \MinGW\msys\1.0\home\(username)\bfgminer
  225. libcurl.dll from \MinGW\bin
  226. libidn-11.dll from \MinGW\bin
  227. libeay32.dll from \MinGW\bin
  228. ssleay32.dll from \MinGW\bin
  229. libpdcursesw.dll from \MinGW\bin
  230. pthreadGC2.dll from \MinGW\bin
  231. libjansson-X.dll from \MinGW\msys\1.0\local\bin
  232. libblkmaker_jansson-0.1-0.dll
  233. from \MinGW\msys\1.0\home\(username)\bfgminer\libblkmaker\.libs
  234. libblkmaker-0.1-0.dll
  235. from \MinGW\msys\1.0\home\(username)\bfgminer\libblkmaker\.libs
  236. ######################################################################################
  237. # #
  238. # Native WIN32 setup and build instructions (on mingw32/Windows) complete #
  239. # #
  240. ######################################################################################