How to mine Monero/XMR on macOS
A quick and easy guide to mining XMR/monero for Mac users
I have compiled command line miners for XMR available here (including updated versions for RandomX):
Command line miners for Mac
With instructions included. You can also buy Monero/XMR by clicking this link:
But if you'd rather compile the code and mine Monero yourself, here are some simple instructions:
Note that there were originally separate projects for GPU and CPU mining XMR which have been merged together. The first tutorial here will focus on the newer, merged miner, and below that will remain the instructions for the older miners from the original tutorial.
Compiling xmr-stak for macOS
The code for the miner can be found here:
https://github.com/fireice-uk/xmr-stak
These instructions require homebrew, which you can get from http://brew.sh
To compile for AMD GPUs and CPU mining use the following commands in the Terminal app:
brew install cmake openssl hwloc libmicrohttpd
git clone https://github.com/fireice-uk/xmr-stak.git
cd xmr-stak
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCUDA_ENABLE=OFF .
make install
./bin/xmr-stak
The last command starts the miner and will present you with a setup dialog where you can enter your pool details.
To compile for Nvidia GPUs and CPU mining use the following commands in the Terminal app:
brew tap caskroom/drivers
brew cask install nvidia-cuda
brew install hwloc libmicrohttpd gcc openssl cmake
git clone https://github.com/fireice-uk/xmr-stak.git
cd xmr-stak
cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOpenCL_ENABLE=OFF
make install
./bin/xmr-stak
The last command starts the miner and will present you with a setup dialog where you can enter your pool details.
To compile for CPU mining only use the following commands in the Terminal app:
brew install hwloc libmicrohttpd gcc openssl cmake
git clone https://github.com/fireice-uk/xmr-stak.git
cd xmr-stak
cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
make install
./bin/xmr-stak
The last command starts the miner and will present you with a setup dialog where you can enter your pool details.
To compile for AMD or Nvidia only without the cpu mining capability, add the flag -DCPU_ENABLE=OFF to the cmake command.
If you need any more help running the miner, please check out the forum at fabulouspanda.com
Compiling the older xmr-stak-amd and xmr-stak-cpu for macOS
For AMD GPU mining, you can find the code for a miner at https://github.com/fireice-uk/xmr-stak-amd
You'll need to install the dependencies libhttpd and openssl - I used homebrew which you can get from http://brew.sh run
brew install git libmicrohttpd openssl
then run
git clone https://github.com/fireice-uk/xmr-stak-amd.git
cd xmr-stak-amd
git checkout dev
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .
make
a folder called bin will now contain a binary called xmr-stak-amd which is what you can use to GPU mine XMR/Monero move the config.txt file from the parent directory in to the bin folder and edit it so the lines below look like this:
"gpu_thread_num" : 1,
"gpu_threads_conf" : [
{ "index" : 0, "intensity" : 256, "worksize" : 8, "affine_to_cpu" : false },
],
for most Macs, if you have a 'trashcan' Mac Pro or any other macOS setups with two GPUs like this:
"gpu_thread_num" : 2,
"gpu_threads_conf" : [
{ "index" : 0, "intensity" : 256, "worksize" : 8, "affine_to_cpu" : false },
{ "index" : 1, "intensity" : 256, "worksize" : 8, "affine_to_cpu" : false },
],
Make sure to change the pool details in the config.txt file to your pool details too and you'll be good to go!
Now you can run the xmr-stak-amd binary in Terminal and it'll connect to your pool and start mining straight away.
If you need any more help please check out http://fabulouspanda.com/forum
For XMR CPU mining grab the code from
https://github.com/fireice-uk/xmr-stak-cpu/
You can just download the zip as you don't need to get a particular branch for the CPU miner to work Use homebrew as outlined above to install libmicrohttpd and openssl but also run
brew install hwloc
then cd to the xmr-stak-cpu folder and run
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .
make
edit the config.txt file with your pool details and as with the GPU miner, you're ready to go!
Happy mining, I'd love to see your results so if you're willing to share please do head over to the http://fabulouspanda.com forum