windows-build.txt 15 KB

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