Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

This assumes you have brew installed and are comfortable using a terminal.

Following the guide on https://github.com/tpruvot/cpuminer-multi will likely lead to errors about invalid paths to OpenSSL, and neoscrypt errors to the tune of Undefined symbols for architecture x86_64 during the build. I managed to piece together different fixes into an installation that has worked for me. So I hope it works for you.

Requirements

Ensure a c compiler is installed. Type g++ in the terminal and continue with the xcode installation if necessary. If it prints clang: error: no input files, then you can proceed.

# install dependencies
brew install automake openssl zlib curl jansson make

Installation

# clone repo
git clone https://github.com/tpruvot/cpuminer-multi.git

# run build scripts
cd cpuminer-multi
./autogen.sh
./nomacro.pl
# where /usr/local/opt/openssl is your brew bin openssl
./configure CFLAGS="-march=native" --with-crypto=/usr/local/opt/openssl  --with-curl
# Due to some issues within ASM Neoscrypt
perl -p -i -e "s/#if \(WINDOWS\)/#define ASM 0\n#if (WINDOWS)/g" algo/neoscrypt.c
# aaand make
make

Start mining!

# example, using Ravencoin on suprnova
./cpuminer -a x16r -o stratum+tcp://rvn.suprnova.cc:6666 -u [username].[workername] -p [workerpassword]

To stop mining just kill the process with ctrl+c, then start it up again when required.

To adjust your mining power, use the -t flag. -t is the number of CPU cores (threads) to use when mining. So ./cpuminer -a x16r -t 1 ... would just use 1 core (good for mining in the background). I believe by default it uses all available cores.

Thanks to

https://github.com/Roykk/veriumMinerDocker/tree/master/OSXwithoutDocker (SSL paths issue) https://bitcointalk.org/index.php?topic=841401.msg13025434#msg13025434 (User wladston with the perl fix)

Tip jar

💱 🍺
RVN RX1Rcn7BRorWvq8HPih8Y7Pg1ZVo7fp7Du
BTC 1HSbmfcqWxNA2AHmK8qLLcJoBzRBankZu9
LTC LPkFXzY59DgAKMpvg94Cg3LbofwcgTz4ko
ETH 0x22dF535A59f6c0f9E96f5631D4B0c0a975E926C8
@SterlingChin

This comment has been minimized.

SterlingChin commented Feb 1, 2018

This may help clear up some confusion for some when it comes to the mining command example you provided.

./cpuminer -a x16r -o stratum+tcp://rvn.suprnova.cc:6666 -u [username].[workername] -p [workerpassword]

@SterlingChin

This comment has been minimized.

SterlingChin commented Feb 1, 2018

Also, sent you a thank you!

@quagliero

This comment has been minimized.

Owner

quagliero commented Feb 3, 2018

@SterlingChin - good point, have updated the gist. Thanks for the tip! 👍

@parsnippp

This comment has been minimized.

parsnippp commented Feb 4, 2018

- figured it out. Thanks.

@XaocuHKa

This comment has been minimized.

XaocuHKa commented Feb 8, 2018

can i use your pre-compiled version? or it wont work standalone?

@BrazilianGirl

This comment has been minimized.

BrazilianGirl commented Feb 19, 2018

I need help to make it run on Octa Core ARM .

@quagliero

This comment has been minimized.

Owner

quagliero commented Feb 22, 2018

@XaocuHKa @BrazilianGirl - Sorry, I don't seem to get email notifications when this is commented on. Still need help?

@Andrewjamesk76

This comment has been minimized.

Andrewjamesk76 commented Feb 24, 2018

when I run ./cpuminer -a x16r -o stratum+tcp://rvn.suprnova.cc:6666 -u [username].[workername] -p [workerpassword] i am getting an error- no just file or directory can you tell me which directory i can find the file in?

@BrazilianGirl

This comment has been minimized.

BrazilianGirl commented Feb 24, 2018

works fine here!

@tetreault

This comment has been minimized.

tetreault commented Feb 24, 2018

Hey I'm running this on a 2017 MBP with a 2.9GHz intel i5 cpu and wanted to mess around with cpu mining ravencoin. Followed all the steps, got my suprnova account but it keeps saying:

screenshot 2018-02-24 16 38 47

Any ideas what I'm doing wrong here?

I'm running it like this @quagliero: ./cpuminer -a x16r -o stratum+tcp://rvn.suprnova.cc:6666 -u ME.MyWorker -p "PASSWORDHERE"

@losgatossuave

This comment has been minimized.

losgatossuave commented Feb 24, 2018

Hi - I can't get this script to run: perl -p -i -e "s/#if (WINDOWS)/#define ASM 0\n#if (WINDOWS)/g" algo/neoscrypt.c

I have no idea why. It seems that without it, i get neoscript errors on make. Thanks

@FGNBIRDFGKTZHJNV9JH45

This comment has been minimized.

FGNBIRDFGKTZHJNV9JH45 commented Feb 25, 2018

@Andrewjamesk76 i'm getting the same error: No such file or directory
could you already figure out the problem here?

@claudiablo

This comment has been minimized.

claudiablo commented Feb 25, 2018

Hi I was following your guide till this popped up as I entered the command 'make'

ld: warning: directory not found for option '-Lyes/lib'

I was wondering if you could help me. Thank you in advance.

@ciribo

This comment has been minimized.

ciribo commented Feb 26, 2018

Hi,
I'm stuck at the git clone command.

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Seems like I don't have the right permission. What could I do to fix this?
Thanks

@quagliero

This comment has been minimized.

Owner

quagliero commented Feb 26, 2018

@claudiablo - that's just a warning, shouldn't prevent it from running (I, and others, have the same warning). It's likely fixable by passing in the full path to one of the libs it uses in the Makefile. But it should work without it.

@quagliero

This comment has been minimized.

Owner

quagliero commented Feb 26, 2018

@FGNBIRDFGKTZHJNV9JH45 @Andrewjamesk76 where abouts are you running the command from? Any errors when running through the build steps?

@quagliero

This comment has been minimized.

Owner

quagliero commented Feb 26, 2018

@tetreault You don't need to wrap your password in quotes, it will mean your authentication is failing as your password is incorrect. -u Me.MyWorker -p mypassword

@quagliero

This comment has been minimized.

Owner

quagliero commented Feb 26, 2018

@losgatossuave what happens when you try and run the perl script? Any errors?

@90III01

This comment has been minimized.

90III01 commented Feb 27, 2018

@quagliero can you please tell me how start literally from ZERO on osx?

@quagliero

This comment has been minimized.

Owner

quagliero commented Feb 27, 2018

@90III01 install brew and xcode, open up a terminal window, and then follow the Installation guide.

@90III01

This comment has been minimized.

90III01 commented Feb 27, 2018

Okay, I'm downloading xCode and Brew, I'll let you know! Thanks!

@90III01

This comment has been minimized.

90III01 commented Feb 27, 2018

@quagliero I tried to run git clone git@github.com:tpruvot/cpuminer-multi.git

I got this error:
Permanently added the RSA host key for IP address ' *** . ** . *** . *** ' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

@quagliero

This comment has been minimized.

Owner

quagliero commented Feb 27, 2018

@90III01 That's a git issue, will be lots of solutions via Google search: facebookresearch/deepmask#23

@shalom-ormsby

This comment has been minimized.

shalom-ormsby commented Mar 1, 2018

@quagliero Thanks for these awesome instructions, which worked perfectly, and I'm mining away with Suprnova. Can you please add instruction for how to pause and resume the mining in Terminal? And any other useful commands? Thanks in advance!

Also, is anyone aware of instructions like this for setting up GPU mining on the Mac?

@claudiablo

This comment has been minimized.

claudiablo commented Mar 1, 2018

for those who have trouble on running this code: git clone git@github.com:tpruvot/cpuminer-multi.git

try replacing with this one right here: git clone https://github.com/tpruvot/cpuminer-multi.git

Hope it will work!

@quagliero

This comment has been minimized.

Owner

quagliero commented Mar 1, 2018

@shalom-ormsby good to hear! To pause/resume I just kill the process with ctrl+c, then start it up again when required. As far as useful commands, -t is the thread count, or CPU cores, to use when mining. So -t 1 would just use 1 core (good for when you still want the machine to be usable!)

@shalom-ormsby

This comment has been minimized.

shalom-ormsby commented Mar 1, 2018

@quagliero Thanks! Really appreciate your help getting up and running with CPU mining on the Mac. Do you know if it's possible to do GPU-based mining on the Mac? I'm only seeing instructions and resources for Win-based systems.

@quagliero

This comment has been minimized.

@shalom-ormsby

This comment has been minimized.

shalom-ormsby commented Mar 3, 2018

@quagliero Will do. Thanks again!

@Serion717

This comment has been minimized.

Serion717 commented Mar 4, 2018

Hi, after I type make, I get this error... Any ideas on what I can do?

make
/Library/Developer/CommandLineTools/usr/bin/make all-recursive
Making all in compat
make[3]: Nothing to be done for all-am'. gcc -DHAVE_CONFIG_H -I. -Iyes/include -I/usr/local/opt/opensll/include -fno-strict-aliasing -I. -Iyes/include -I/usr/local/opt/opensll/include -Wno-pointer-sign -Wno-pointer-to-int-cast -march=native -Iyes/include -I/usr/local/opt/opensll/include -MT cpuminer-cpu-miner.o -MD -MP -MF .deps/cpuminer-cpu-miner.Tpo -c -o cpuminer-cpu-miner.o test -f 'cpu-miner.c' || echo './'`cpu-miner.c
cpu-miner.c:28:10: fatal error: 'openssl/sha.h' file not found
#include <openssl/sha.h>
^~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [cpuminer-cpu-miner.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

@quagliero

This comment has been minimized.

Owner

quagliero commented Mar 4, 2018

@Serion717 looks like your openssl isn't linking correctly, have a look here: https://github.com/Roykk/veriumMinerDocker/tree/master/OSXwithoutDocker#troubleshooting

@asheikhyusuf

This comment has been minimized.

asheikhyusuf commented Mar 13, 2018

messages image 1031840701
constantly get this. also it takes a long time for it to connect to worker. I started at 100% battery now I'm at 52% battery life and it hasn't even cleared one yet. My worker stay inactive for some reason

@Aidy100

This comment has been minimized.

Aidy100 commented Mar 13, 2018

Hi. I was running this and everything was fine until last night. Now if I try to run all I get is
./cpuminer: No such file or directory
I've gone back to the very first step (g++) and followed all the instructions but all I get is 'no such file or directory'.
Any thoughts?

@chabgood

This comment has been minimized.

chabgood commented Mar 16, 2018

I run this same stratum and login and such on windows 10 and it works great, but on mac, 10.3.3, i get:
stratum_subscribe send failed
[2018-03-16 17:44:25] ...retry after 10 seconds

@rvaoms

This comment has been minimized.

rvaoms commented Mar 23, 2018

I have tried multiple times on my iMac and I keep getting this error:

-bash: /cpuminer: No such file or directory

@avril-verhaeghen

This comment has been minimized.

avril-verhaeghen commented Mar 27, 2018

@rvaoms it's ./cpuminer not /cpuminer, don't forget the dot

@cryptickt

This comment has been minimized.

cryptickt commented Mar 27, 2018

thanks so much for posting instructions however when I type in make, i get this message
ld: warning: directory not found for option '-Lyes/lib'
ld: warning: directory not found for option '-Lyes/lib'
Dont know what to do now, any help is appreciated thanks in advance

@quagliero

This comment has been minimized.

Owner

quagliero commented Mar 28, 2018

@cryptickt - those are just warnings, shouldn't prevent it from running.

@quagliero

This comment has been minimized.

Owner

quagliero commented Mar 28, 2018

@asheikhyusuf & @chabgood - try it with a different pool and see if it still can't connect. If it can't, could be a port blocking/firewall issue, try turning them off temporarily and trying again.

@DKLALA

This comment has been minimized.

DKLALA commented Apr 7, 2018

sadly the same problem. works all the way up until your "start mining" command and terminal returns "no such file or directory". Anybody figure out a fix for this yet?

@matt24ray

This comment has been minimized.

matt24ray commented Apr 10, 2018

I got it up and running on 10.12.6 as well.

@quagliero

This comment has been minimized.

Owner

quagliero commented Apr 23, 2018

@DKLALA Does the cpuminer file exist if you ls in that directory? No such file or directory usually means you're missing the . at the start and it's just looking for /cpuminer, which it can't find: ./cpuminer ...

@dburlington

This comment has been minimized.

dburlington commented May 7, 2018

Very cool - worked like a charm. Hard to believe that X16r can work on CPU. Although xmr-stak on Monero is going to give way better results (meaning a whopping .20c/day - lol). Running a 2017 MBP 13" with i7 fully loaded. But really can't get much hash on a CPU with RVN. I get about 100hz/s on XMR. Looks like I get about 20Khz on X16r. Really fun to play with though. Great instructions!! Dying to try it on my 15" MBP - way more power but still suspect Cryptonight performs better on CPU. I can only get about 50Mhz out of my 6 card AMD rx580 rig so its a challenging algo all around. Great coin though.

@superpilot21

This comment has been minimized.

superpilot21 commented May 9, 2018

When I type : ./autogen.sh

I get: ./autogen.sh: line 8: aclocal: command not found

@Kezchenko

This comment has been minimized.

Kezchenko commented May 11, 2018

Hi,

I am running the mining but I am not getting accepted yes! to contribute to the pool. Any ideas

@quagliero

This comment has been minimized.

Owner

quagliero commented May 14, 2018

@Kezchenko Which coin? RVN? Could just be due to the sheer number of miners and hashrate on the network that your CPU isn't submitting any valid shares in time.

@superpilot21 Strange. Did all of the brew dependencies install correctly? aclocal is part of automake so maybe try brew install automake?

@timogoosenwork

This comment has been minimized.

timogoosenwork commented May 18, 2018

This might help if you don't know where openssl is installed:

$ ./configure CFLAGS="-march=native" --with-crypto=`which openssl` --with-curl
@msettecasse

This comment has been minimized.

msettecasse commented May 23, 2018

what username and worker and password should i set in the command line?????

@quagliero

This comment has been minimized.

Owner

quagliero commented May 31, 2018

whatever the username and password is for your pool worker (a lot of times the password isn't required and the username is your wallet address)

@urugn

This comment has been minimized.

urugn commented Jun 15, 2018

Hi

I keep getting boooo
[2018-06-15 14:43:42] accepted: 0/2 (diff 0.000), 109.42 H/s booooo
in the mac but the same miner works fine under linux fedora 26 and centos. Am using coinfoundry.org for xmr mining in both machines. what could be wrong?

@rorofernandez

This comment has been minimized.

rorofernandez commented Oct 26, 2018

Just wondering if someone can help me of the error I'm getting when I execute the 'make' command. Thanks a lot in advance.

*1 warning generated.
mv -f algo/.deps/cpuminer-neoscrypt.Tpo algo/.deps/cpuminer-neoscrypt.Po
gcc -DHAVE_CONFIG_H -I. -Iyes/include -I/usr/local/opt/openssl/include -fno-strict-aliasing -I. -Iyes/include -I/usr/local/opt/openssl/include -Wno-pointer-sign -Wno-pointer-to-int-cast -march=native -Iyes/include -I/usr/local/opt/openssl/include -MT algo/cpuminer-rainforest.o -MD -MP -MF algo/.deps/cpuminer-rainforest.Tpo -c -o algo/cpuminer-rainforest.o test -f 'algo/rainforest.c' || echo './'algo/rainforest.c
algo/rainforest.c:550:44: error: unknown type name 'ulong'
static inline void rf_w128(uint64_t cell, ulong ofs, uint64_t x, uint64_t y) {
^
1 error generated.
make[2]: *** [algo/cpuminer-rainforest.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

@twilms

This comment has been minimized.

twilms commented Oct 27, 2018

Getting the same error as rorofernandez above. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment