Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Cgminer Windows compile instructions version 3.4

By: Sharky112065 on Feb 25th, 2012  |  syntax: None  |  size: 15.41 KB  |  views: 7,374  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ######################################################################################
  2. #                                                                                    #
  3. #          Native WIN32 setup and build instructions (on mingw32/Windows):           #
  4. #                                                                                    #
  5. ######################################################################################
  6.  
  7. **************************************************************************************
  8. * Introduction                                                                       *
  9. **************************************************************************************
  10. The following instructions have been tested on both Windows 7 and Windows XP.
  11. Most of what is described below (copying files, downloading files, etc.) can be done
  12. directly in the MinGW MSYS shell; these instructions do not do so because package
  13. versions and links change over time. The best way is to use your browser, go to the
  14. links directly, and see for yourself which versions you want to install.
  15. Winrar was used to do the extracting of archive files in the making of this guide.
  16.  
  17. If you think that this documentation was helpful and you wish to donate, you can
  18. do so at the following address. 12KaKtrK52iQjPdtsJq7fJ7smC32tXWbWr
  19.  
  20. **************************************************************************************
  21. * A tip that might help you along the way                                            *
  22. **************************************************************************************
  23. Enable "QuickEdit Mode" in your Command Prompt Window or MinGW Command Prompt
  24. Window (No need to go into the context menu to choose edit-mark/copy/paste):
  25. Right-click on the title bar and click Properties. Under the Options tab, check
  26. the box for "QuickEdit Mode". Alternately, if you want this change to be
  27. permanent on all of your Command Prompt Windows; you can click Defaults instead
  28. of Properties as described above. Now you can drag and select text you want to
  29. copy, right-click to copy the text to the clipboard and right-click once again to
  30. paste it at the desired location. You could for example, copy some text from this
  31. document to the clipboard and right click in your Command Prompt Window to paste
  32. what you copied.
  33.  
  34. **************************************************************************************
  35. * Install mingw32                                                                    *
  36. **************************************************************************************
  37. Go to this url ==> http://www.mingw.org/wiki/Getting_Started
  38. Click the link that says "Download and run the latest mingw-get-inst version."
  39. Download and run the latest file. Install MinGW in the default directory.
  40. (I downloaded the one labeled "mingw-get-inst-20120426" - note that this could
  41. be a different version later.)
  42. Make sure to check the option for "Download latest repository catalogs".
  43. I just selected all the check boxes (excluding "Fortran Compiler") so that everything
  44. was installed.
  45.  
  46. **************************************************************************************
  47. * Run the MSYS shell for the first time to create your user directory                *
  48. **************************************************************************************
  49. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  50. This will create your user directory for you.
  51.  
  52. **************************************************************************************
  53. * Install libpdcurses                                                                *
  54. **************************************************************************************
  55. Type the lines below to install libpdcurses.
  56. mingw-get install mingw32-libpdcurses
  57. mingw-get install mingw32-pdcurses
  58. Ctrl-D or typing "logout" and pressing the enter key should get you out of the
  59. window.
  60.  
  61. **************************************************************************************
  62. * Copy CGMiner source to your MSYS working directory                                 *
  63. **************************************************************************************
  64. Copy CGMiner source code directory into:
  65. \MinGW\msys\1.0\home\(folder with your user name)
  66.  
  67. **************************************************************************************
  68. * Install AMD APP SDK, latest version (only if you want GPU mining)                  *
  69. **************************************************************************************
  70. Note: You do not need to install the AMD APP SDK if you are only using Nvidia GPU's
  71. Go to this url for the latest AMD APP SDK:
  72.  http://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspx
  73. Go to this url for legacy AMD APP SDK's:
  74.  http://developer.amd.com/sdks/AMDAPPSDK/downloads/pages/AMDAPPSDKDownloadArchive.aspx
  75. Download and install whichever version you like best.
  76. Copy the folders in \Program Files (x86)\AMD APP\include to \MinGW\include
  77. Copy \Program Files (x86)\AMD APP\lib\x86\libOpenCL.a to \MinGW\lib
  78. Note: If you are on a 32 bit version of windows "Program Files (x86)" will be
  79. "Program Files".
  80. Note2: If you update your APP SDK later you might want to recopy the above files
  81.  
  82. **************************************************************************************
  83. * Install AMD ADL SDK, latest version (only if you want GPU monitoring)              *
  84. **************************************************************************************
  85. Note: You do not need to install the AMD ADL SDK if you are only using Nvidia GPU's
  86. Go to this url ==> http://developer.amd.com/sdks/ADLSDK/Pages/default.aspx
  87. Download and unzip the file you downloaded.
  88. Pull adl_defines.h, adl_sdk.h, and adl_structures.h out of the include folder
  89. Put those files into the ADL_SDK folder in your source tree as shown below.
  90. \MinGW\msys\1.0\home\(folder with your user name)\cgminer-x.x.x\ADL_SDK
  91.  
  92. **************************************************************************************
  93. * Install GTK-WIN, required for Pkg-config in the next step                          *
  94. **************************************************************************************
  95. Go to this url ==> http://sourceforge.net/projects/gtk-win/
  96. Download the file.
  97. After you have downloaded the file Double click/run it and this will install GTK+
  98. I chose all the selection boxes when I installed.
  99. Copy libglib-2.0-0.dll and intl.dll from \Program Files (x86)\gtk2-runtime\bin to
  100. \MinGW\bin
  101. Note: If you are on a 32 bit version of windows "Program Files (x86)" will be
  102. "Program Files".
  103.  
  104. **************************************************************************************
  105. * Install pkg-config                                                                 *
  106. **************************************************************************************
  107. Go to this url ==> http://www.gtk.org/download/win32.php
  108. Scroll down to where it shows pkg-cfg.
  109. Download the file from the tool link. Extract "pkg-config.exe" from bin and place in
  110. your  \MinGW\bin directory.
  111. Download the file from the "Dev" link. Extract "pkg.m4" from share\aclocal and place
  112. in your \MingW\share\aclocal directory.
  113.  
  114. **************************************************************************************
  115. * Install libcurl                                                                    *
  116. **************************************************************************************
  117. Go to this url ==> http://curl.haxx.se/download.html#Win32
  118. At the section where it says "Win32 - Generic", Click on the link that indicates
  119. Win32 2000.XP 7.27.0 libcurl SSL and download it.
  120. The one I downloaded may not be current for you. Choose the latest.
  121. Extract the files that are in the zip (bin, include, and lib) to their respective
  122. locations in MinGW (\MinGW\bin, \MinGW\include, and \MinGW\lib).
  123. Edit the file \MinGW\lib\pkgconfig\libcurl.pc and change "-lcurl" to
  124. "-lcurl -lcurldll".
  125. Ref. http://old.nabble.com/gcc-working-with-libcurl-td20506927.html
  126.  
  127. **************************************************************************************
  128. * Build cgminer.exe                                                                  *
  129. **************************************************************************************
  130. Run the MinGW MSYS shell
  131. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  132. Change the working directory to your CGMiner project folder.
  133. Example: cd cgminer-2.1.2 [Enter Key] if you are unsure then type "ls -la"
  134. Another way is to type "cd cg" and then press the tab key; It will auto fill.
  135. Type the lines below one at a time. Look for problems after each one before going on
  136. to the next.
  137.  
  138.       adl.sh (optional - see below)
  139.       autoreconf -fvi
  140.       CFLAGS="-O2 -msse2" ./configure (additional config options, see below)
  141.       make
  142.       strip cgminer.exe  <== only do this if you are not compiling for debugging
  143.  
  144. **************************************************************************************
  145. * Copy files to a build directory/folder                                             *
  146. **************************************************************************************
  147. Make a directory and copy the following files into it. This will be your CGMiner
  148. Folder that you use for mining. Remember the .cl filenames could change on later
  149. releases. If you installed a different version of libcurl then some of those dll's
  150. may be different as well.
  151.   cgminer.exe     from \MinGW\msys\1.0\home\(username)\cgminer-x.x.x
  152.   *.cl            from \MinGW\msys\1.0\home\(username)\cgminer-x.x.x
  153.   README          from \MinGW\msys\1.0\home\(username)\cgminer-x.x.x
  154.   libcurl.dll     from \MinGW\bin
  155.   libidn-11.dll   from \MinGW\bin
  156.   libeay32.dll    from \MinGW\bin
  157.   ssleay32.dll    from \MinGW\bin
  158.   libpdcurses.dll from \MinGW\bin
  159.   pthreadGC2.dll  from \MinGW\bin
  160.  
  161. **************************************************************************************
  162. * Optional - Install Git into MinGW/MSYS                                             *
  163. **************************************************************************************
  164. Go to this url ==> http://code.google.com/p/msysgit/
  165. Click on the Downloads tab.
  166. Download the latest "Portable" git archive.
  167. Extract the git*.exe files from the bin folder and put them into \MinGW\bin.
  168. Extract the share\git-core folder and place it into \MinGW\share.
  169. After the previous step you should have a folder called \MinGW\share\git-core.
  170. To test if it is working, open a MinGW shell and type the following:
  171.   git config -–global core.autocrlf false (note: one time run only)
  172.   git clone git://github.com/ckolivas/cgminer.git
  173.  
  174. If you simply just want to update the source after you have already cloned, type:
  175.   git pull
  176. "git pull" did not work for me. Try the following which does the same thing:
  177.   git fetch && git merge FETCH_HEAD
  178.  
  179. Now you can get the latest source directly from github.
  180.  
  181. **************************************************************************************
  182. * Optional - Make a .sh file to automate copying over ADL files                      *
  183. **************************************************************************************
  184. Make a folder/directory in your home folder and name it ADL_SDK.
  185.  (ref:  \MinGW\msys\1.0\home\(folder with your user name)\ADL_SDK)
  186. Copy the ADL .h files into that folder/directory.
  187. Open your favorite text editor and type the following into it.
  188.  cp -av ../ADL_SDK/*.h ADL_SDK
  189. Save the file as "adl.sh" and then place the file into "\MinGW\msys\1.0\bin".
  190. From now on when your current working directory is the cgminer source directory
  191. You can simply type "adl.sh" and it will place the ADL header files into place
  192. For you. Make sure you never remove the ADL_SDK folder from your home folder.
  193.  
  194. **************************************************************************************
  195. * Optional - Install libusb if you need auto USB device detection; required for Ztex *
  196. **************************************************************************************
  197. Go to this url ==> http://git.libusb.org/?p=libusb.git;a=snapshot;h=master;sf=zip
  198. save the file to your local storage. Open the file and copy the libusb* folder to
  199. \MinGW\msys\1.0\home\(your user directory/folder).
  200. Or if you do not want to download the file directly and would like to use git then
  201. Type the following from the MSYS shell in your home folder.
  202. git clone git://git.libusb.org/libusb.git
  203.  
  204. Run the MinGW MSYS shell
  205. (Start Icon/keyboard key ==> All Programs ==> MinGW ==> MinGW Shell).
  206. Change the working directory to your libusb project folder.
  207. Example: cd libusb-something [Enter Key] if you are unsure then type "ls -la"
  208. Another way is to type "cd libusb" and then press the tab key; It will auto fill.
  209. Type the lines below one at a time. Look for problems after each one before going on
  210. to the next.
  211.  
  212. ./autogen.sh --disable-debug-log --prefix=/MinGW
  213. make
  214. make install
  215.  
  216. You may now exit the MSYS shell.
  217. Ctrl-D or typing "logout" and pressing the enter key should get you out of the
  218. window.
  219.  
  220. You will have to copy "libusb-1.0.dll" to your working cgminer binary directory.
  221. You will find "libusb-1.0.dll" in the \MinGW\bin directory/folder.
  222.  
  223. Use this method if libusb does not work for you on Ztex. Once someone lets us know
  224. Libusb works instead of libusbx then we will remove the section below this line.
  225. Run the MSYS shell and change into the libusb folder as above.
  226. Type ==> make uninstall
  227. Go to this url ==> http://libusbx.org/
  228. Click on the "Downloads" tab.
  229. Click on "releases".
  230. Click on the latest version. I downloaded 1.0.14; yours may be newer.
  231. Do not download from the link that says "Looking for the latest version?".
  232. Click on "Windows"
  233. Click on the file and download it. I downloaded libusbx-1.0.12-win.7z.
  234. Extract the the following from the file and place in where directed.
  235. Copy libusb.h from include\libusbx-1.0 to \MinGW\include\libusb-1.0\libusb.h
  236. Copy contents of MinGW32\static \MinGW\lib
  237. Copy contents of MinGW32\dll to \MinGW\lib
  238. You will have to copy "libusb-1.0.dll" to your working cgminer binary directory.
  239.  
  240. **************************************************************************************
  241. * Some ./configure options                                                           *
  242. **************************************************************************************
  243. --enable-cpumining      Build with cpu mining support(default disabled)
  244. --disable-opencl        Override detection and disable building with opencl
  245. --disable-adl           Override detection and disable building with adl
  246. --enable-bitforce       Compile support for BitForce FPGAs(default disabled)
  247. --enable-icarus         Compile support for Icarus Board(default disabled)
  248. --enable-modminer       Compile support for ModMiner FPGAs(default disabled)
  249. --enable-ztex           Compile support for Ztex Board(default disabled)
  250. --enable-scrypt         Compile support for scrypt litecoin mining (default disabled)
  251. --without-curses        Compile support for curses TUI (default enabled)
  252. --without-libudev       Autodetect FPGAs using libudev (default enabled)
  253.  
  254. ######################################################################################
  255. #                                                                                    #
  256. #       Native WIN32 setup and build instructions (on mingw32/Windows) complete      #
  257. #                                                                                    #
  258. ######################################################################################