Mac mining guide
DISCLAIMER: MOST APPLE-PRODUCED COMPUTERS HAVE RELATIVELY PUNY GRAPHICS CARDS. DON'T EXPECT AMAZING HASH RATES. MANY APPLE-PRODUCED COMPUTERS ALSO HAVE EXTREMELY TERRIBLE COOLING. YOU CAN AND WILL FRY YOUR CARD IF YOU AREN'T CAREFUL ABOUT TEMPERATURE. BE VERY CAREFUL ABOUT YOUR GRAPHICS CARD'S TEMPERATURE.
Option #1: Asteroid
Step 1: Download Asteroid.
Step 2: Run Asteroid.app.
Step 3: Select "New Pool" and input the info for your mining pool. MAKE SURE TO SELECT "Litecoin (scrypt)" under "Coin type".
Step 4: Click "Accept". Asteroid should attempt to connect to the pool. If it can connect, it'll then start mining.
If you have a NVIDIA card (NOT an AMD card) and want to drastically improve your hashrate, you can compile CudaMiner (see below).
Option #2: CudaMiner
CudaMiner is a HUGE pain to compile from source.
If you're running 10.9, use this guide: http://atomton.roon.io/compiling-cudaminer-on-os-x-10-9
If you're running 10.8, there are a number of additional steps to follow (which I discovered when I tried to follow that guide on 10.8). Here's a revised guide that should be almost completely idiotproof. I ran into a number of problems when attempting to follow the 10.9 guide, so this one contains all of the fixes that I remember using to get CudaMiner to compile on my 10.8 install. I may have forgotten to add a few, and I'm not completely sure if all of them are necessary, but this worked for me, so it should work for other people on 10.8.
SOMEONE OTHER THAN MYSELF WHO RUNS 10.8 NEEDS TO TEST THIS TUTORIAL TO CONFIRM THAT IT WORKS ON OTHER 10.8 INSTALLS
PLEASE NOTE: THE TUTORIAL REQUIRES THAT YOU ARE RUNNING AN ACCOUNT THAT HAS ACCESS TO SUDO. YOU WILL NEED TO INPUT YOUR PASSWORD SEVERAL TIMES DURING THIS TUTORIAL. SUDO IS A LOCAL PROGRAM, IT WILL NOT STEAL YOUR PASSWORD.
Before you begin: You MUST have XCode and Nvidia Toolkit 5.5 installed. You can download XCode from the Mac App Store for free here. You can install/update Nvidia CUDA toolkit to version 5.5 here (select the PKG link for your version of Mac OSX).
Step 1: Open XCode, click the "XCode" menu item, select "Preferences", click "Downloads", then click the "Install" button next to the "Command Line Tools" item. Wait for the installation to finish before moving on to the next step.
Step 2: Install MacPorts (you can download it here). MacPorts MUST be installed before you can continue. If the commands below result in "command not found", you didn't install MacPorts correctly.
Step 3: Open Terminal.app and execute the following commands (one after each other):
sudo port install gcc46
sudo port select --set gcc mp-gcc46
sudo port install automake autoconf curl
sudo port install pkgconfig
sudo port selfupdate
sudo port clean wget
sudo port install wget
sudo port clean openssl
sudo port install openssl
Step 4: Execute this command:
sudo vi ~/.bash_profile
Step 5: Look at the screen shown. If it looks mostly blank (there'll be a bunch of these characters "~"), skip to step 7. If it isn't blank, do step 6 first.
Step 6: Press ":", then type in "q!" and press enter. Run the below commands and skip to Step 7.
sudo mv ~/.bash_profile ~/.bash_profile.old
sudo vi ~/.bash_profile
(note: Advanced users should just compare the existing bash profile and merge in the changes. If you don't understand what a bash profile is and how you'd do that, DON'T try anything, just follow my commands.)
Step 7: Press "i", then paste the below into the file:
export PATH=/Developer/NVIDIA/CUDA-5.5/bin:$PATH
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-5.5/lib:$DYLD_LIBRARY_PATH
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Step 8: Press the escape key, then press ":", then type in "wq" and hit enter.
Step 9: Quit and reopen Terminal.app.
Step 10: Open https://github.com/cbuchner1/CudaMiner in your web browser. Click the "Download ZIP" button (located on the right-hand side of the screen). A file named "CudaMiner-master.zip" will be downloaded. If your web browser hasn't already extracted it, open the zip file to extract it. A folder named "CudaMiner-master" should appear. Open the folder in Finder, then move to the next step.
Step 11: Type "cd" into Terminal, followed by a space. DO NOT PRESS ENTER. In your Finder window for "CudaMiner-master", there should be a file icon at the top. Drag and drop this file icon into terminal, then press enter in terminal. DO NOT CLOSE THE TERMINAL WINDOW AFTER THIS. YOU WILL NEED TO LEAVE THIS TERMINAL WINDOW OPEN.
Step 12: Enter the following command into the open terminal window from step 11.
vi scrypt.cpp
Step 13: Press "/", then copy/paste "include <malloc" (EXACTLY like that, NO QUOTES), then press enter.
Step 14: Your cursor should be at a line containing "#include <malloc.h>". Press "dd", which will delete the line and shift your cursor to the line below. Press the up arrow key once, then press "o", and paste the following into the file.
#include <malloc/malloc.h>
Step 14: Press the escape key. Press ":", followed by "wq" and press enter. Enter the following into your terminal window.
vi configure.ac
Step 15: Press "/", then input "CUDA_LDFLAGS="-L$with_cuda", then press enter. You should be at a line that reads "CUDA_LDFLAGS="-L$with_cuda/lib$SUFFIX"" (with a few space in front). Press "dd", click the up arrow key once, press "o", enter three spaces, then paste the following.
CUDA_LDFLAGS="-L$with_cuda/lib"
Step 16: Hit the escape key, then press "/", then copy/paste "CUDA_LDFLAGS="-L\/usr\/local\/cuda" (EXACTLY like that, NO QUOTES), then press enter.
Step 17: Your cursor should be at a line containing "CUDA_LDFLAGS="-L/usr/local/cuda/lib"". Press "dd", which will delete the line and shift your cursor to the line below. Press the up arrow key once, then press "o", and paste the following into the file.
CUDA_LDFLAGS="-L/usr/local/cuda/lib"
Step 18: Hit the escape key, then press ";", followed by "wq", and an enter.
Step 19: Enter the following into your terminal window.
vi autogen.sh
Step 20: Press "o", then paste the following into the file.
autoreconf -i
Step 21: Press the escape key, followed by ":", then "wq" and press enter.
Step 22: Execute the below command.
curl http://files.vkk.me/extra/5ceecf6f01407fda7433687196c2020a3d2b1590.m4 -o acinclude.m4
Step 23: Enter the following into terminal and press enter. Wait for it to complete before moving on.
./autogen.sh m4_pattern_allow
Step 24: Enter the following into terminal and press enter. Wait for it to complete before moving on.
./configure.sh
Step 25: Enter the following into terminal and press enter. Wait for it to complete before moving on. This may take a little while to complete.
make
Step 26: Assuming that I didn't forget any steps, that you installed everything correctly, that the source code to CudaMiner didn't drastically change, that make didn't fail, and that my installation attempt works fine on other 10.8 installations, you should have successfully compiled cudaminer. Try running the below command.
ls | grep cudaminer$
Step 27: If you get output with "cudaminer" and nothing else, you've got a compiled installation! Congratulations! Before closing that terminal window, you should test to see if cudaminer is actually working. Try running this command:
./cudaminer --benchmark
Step 28: If that works, you're ready to mine! "./cudaminer --help" will print out some useful documentation. Keep in mind that whenever you want to run cudaminer, you'll need to open terminal, input "cd", add a space, then drag and drop the "CudaMiner-master" file icon into terminal and hit enter before running "./cudaminer".
Here's an example run line:
./cudaminer -o stratum+tcp://pool.website.com:3333 -u username.worker -p workerpassword -l auto
Replace "stratum+tcp://pool.website.com:3333" with whatever your pool uses. For most stratum pools you can probably just replace "pool.website.com" with the proper domain and "3333" with the pool port.
"username" is your pool login username.
"worker" is the username of one of your pool workers.
"workerpassword" is the password for the pool worker you're using.
"-l auto" will simply instruct CudaMiner to choose automatic settings based on your graphics card. It will add some delay between running and mining, and will probably not give you optimal settings, but it'll give you basic settings without the hassle of messing around with command line switches.
Detailed instructions on choosing options for CudaMiner can be found here: http://www.reddit.com/r/Dogecoinmining/comments/1tguse/a_treatise_on_cuda_miner/
Option #3: minerd
Step 1: Download CPUMiner(minerd)
32 bit - outdated
64 bit
Step 2: Create a new folder. I named mine CPUMiner and put it on my desktop. Move the .zip file into the new folder.
Step 3: Unzip the downloaded .zip file.
Step 4: Open up a terminal window (Located at /Applications/Utilities/Terminal.app).
Step 5: Type in the terminal -
chmod +x /Users/StrangeUSB/Desktop/CPUMiner/minerd
(**Note the location of the file will be different depending on where you put your file.)
Step 6: Open TextEdit and create a new text file and type (Make sure you are creating a plain text file) -
cd /Users/StrangeUSB/Desktop/CPUMiner
(**Note this will be the actual location of your folder that contains the minerd file.)
./minerd --url=stratum+tcp://Pool.URL:port# --userpass=WebLogin.Worker:WorkerPassword
Step 7: Save the file in the same folder as the minerd file and name it Mining-Start.command
Step 8: Go back to the terminal and type -
chmod +x /Users/StrangeUSB/Desktop/CPUMiner/Mining-Start.command
Step 9: Double click the Mining-Start.command file.
Step 10: ????????
Step 11: Profit?