One of the latest and greatest BitCoin miners out there these days is CGMiner. It is an advanced and adaptive GPU, FPGA and ASIC miner incorporating all the major BitCoin mining kernels out there (diablo, poclbm, phatk and diakgcn) and has key features such as long-polling, multiple pools, etc.
There are a few options to get this running on a Mac. Until recently, your only option was to download the source code and compile it via Terminal, which I’ve detailed below. In the last couple of days, a few additional options have sprung up. Nate Woolls has built a Homebrew installation that is very simple once you have homebrew installed, but isn’t (yet) part of the official homebrew packages yet. And BitBacco is working on a Mac installer package called MacMiner currently in beta, and he’s looking for testers. And if you want to get set up mining now with as little hassle as possible (but at a slower hash rate), check out BitMinter.
Still want to build it yourself from the latest source code? Here’s what you need to do. I promise it’s not too tough.
- Install Apple’s XCode
This is the IDE for programming on the Mac. Don’t worry, we just need some of the tools that it installs, you won’t actually be working in Xcode. Next:
- Launch XCode
- Go to “Preferences…” under the “Xcode” menu
- Click on the “Downloads” page
- Click the “Install” button beside “Command Line Tools“
- Download cgminer
Download the latest version with “tar.bz2” as the file suffix (not x86_64). Unzip this file wherever you like, and remember the location for when we compile cgminer later on.
- Install Homebrew
Homebrew provides access to lots of little utilities used by command-line apps. We’ll only install the ones we absolutely need for CGMiner.
If you followed my previous guide and you have MacPorts installed, you can remove MacPorts by following the quick instructions here.
- Open Terminal
Enter the following to install the Homebrew packages we’ll need for compiling CGMiner (otherwise known as cgminer’s dependencies):
Checks to see that Homebrew is ready to work and there are no issues. If it returns some warnings, read the text and do what it says to fix it.
brew install coreutils autoconf automake jansson libgcrypt libgpg-error libtool libusb pkg-config yasm curl
Paste all on one line. This downloads, compiles and installs each of the dependencies needed for cgminer in one fell swoop.
- Compile and install CGminer
Enter the following into your terminal, and customize it if you’d like. Each command should be entered on a single line.
cd(drag and drop the cgminer folder onto the Terminal window)
./configure --enable-scrypt PKG_CONFIG_PATH=/usr/local/opt/curl/lib/pkgconfig CFLAGS="-g -O2 -Wall"
sudo make install
- Finished! You should now be able to type “
cgminer” into your Terminal to run it. For a list of command-line options to include (including attaching to a mining pool), see the original documentation for CGMiner. For example, use
cgminer -o http://pool:port -u username -p passwordwith your own values to attach to a pool
Update (2013.04.08): ADL is not supported on the Mac, and is unlikely to be anytime soon in a form that the developers of cgminer would be likely interested in developing for. Therefore, you can live life without ADL (GPU overclocking, temp/fan management, etc) or try downloading a windows version and running it via Boot Camp.
Update (2013.04.09): Changed some formatting in the post for easier copy/paste.
Update (2013.04.25): Switched from MacPorts to Homebrew, and updated guide for cgminer 3.0.1 (previously 2.11.4).
Update (2013.04.29): Updated for cgminer 3.1.0. Added links to other good projects to bring cgminer and bfgminer to mac.
Happy mining!Explore posts in the same categories: BitCoin, Technology