Skip to content

Instantly share code, notes, and snippets.

@quagliero
Last active February 23, 2023 06:07
Show Gist options
  • Star 29 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save quagliero/90f493f123c7b1ddba5428ba0146329a to your computer and use it in GitHub Desktop.
Save quagliero/90f493f123c7b1ddba5428ba0146329a to your computer and use it in GitHub Desktop.
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

If you get an error about Undefined symbols for architecture x86_64:, check out @liukun's solution below.

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
@dburlington
Copy link

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
Copy link

When I type : ./autogen.sh

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

@Kezchenko
Copy link

Hi,

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

@quagliero
Copy link
Author

@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
Copy link

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

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

@msettecasse
Copy link

msettecasse commented May 23, 2018

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

@quagliero
Copy link
Author

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
Copy link

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
Copy link

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
Copy link

twilms commented Oct 27, 2018

Getting the same error as rorofernandez above. :/

@joseph-turner
Copy link

@quagliero i'm also getting the error: unknown type name 'ulong'. Running Mac OS 10.14.1 (Mojave)

@Josh0akley
Copy link

Hey @quagliero, i have downloaded homebrew, but get this error when I input this command:

install dependencies

brew install automake openssl zlib curl jansson make

This comes up:

curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to homebrew.bintray.com:443
Error: Failed to download resource "autoconf"
Download failed: https://homebrew.bintray.com/bottles/autoconf-2.69.mojave.bottle.4.tar.gz

Any Ideas?! Cheers

@lasbr
Copy link

lasbr commented Jan 3, 2019

@quagliero any update on this error? I think few other people are having the same issue. cheers

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

@mudruy
Copy link

mudruy commented Feb 5, 2019

@quagliero any update on this error? I think few other people are having the same issue. cheers

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

+1

@thyeem
Copy link

thyeem commented Feb 12, 2019

@lasbr Have you tried to replace all unsigned long (typed as ulong there) with uint32_t in algo/rainforest.c file?
I had the same issue as well, and was able to build it correctly with the method above.

@Tomcatt
Copy link

Tomcatt commented Mar 29, 2019

Will there be an update to the yescrypt?

@ChrisPtos
Copy link

ChrisPtos commented Jul 14, 2019

When I type : ./autogen.sh

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

Same issue !
Try with automake and i have this :

...:cpuminer-multi Mypseudo$ brew install automake
-bash: brew: command not found

@quagliero
Copy link
Author

@ChrisPtos ...install brew?

@ChrisPtos
Copy link

@ChrisPtos ...install brew?

I don't know... how can i be sure brew is installed ?

@quagliero
Copy link
Author

quagliero commented Jul 15, 2019

@ChrisPtos the very first line of this guide:

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

https://brew.sh/

@ChrisPtos
Copy link

@ChrisPtos the very first line of this guide:

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

https://brew.sh/

Ok ! Brew installed now !
... but i have always same issue for ./autogen.sh

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

:(

@liukun
Copy link

liukun commented Aug 19, 2020

It works on macOS 10.15.6 , thanks!

Just I need to change algo/x16rv2.c line 69

// Pad the 24 bytes tiger hash to 64 bytes
inline void padtiger512(uint32_t* hash) {
	for (int i = (24/4); i < (64/4); i++) hash[i] = 0;
}

from inline to static inline, otherwise, there will be an error:

Undefined symbols for architecture x86_64:
  "_padtiger512", referenced from:
      _x16rv2_hash in cpuminer-x16rv2.o
ld: symbol(s) not found for architecture x86_64

@quagliero
Copy link
Author

Thanks @liukun, have updated the gist.

@francieloliveira
Copy link

How can I mine with Binance pool?
I have a error
[2021-01-25 11:08:10] JSON inval id
[2021-01-25 11:08:10] rpc2_login_decode: fail
[2021-01-25 11:08:44] stratum_recv_line failed
[2021-01-25 11:08:44] Stratum connection interrupted

@quagliero
Copy link
Author

@3wtox Can't help I'm afraid, sorry. This was just something I pieced together 3 years ago!

@antoine78300
Copy link

When I type : ./autogen.sh

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

Same for me. stuck at this stage..

@antoine78300
Copy link

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

Same for me. stuck at this stage..

Solved this but it seems I have not "/usr/local/opt/openssl"

@shubh47-dddd
Copy link

It works on macOS 10.15.6 , thanks!

Just I need to change algo/x16rv2.c line 69

// Pad the 24 bytes tiger hash to 64 bytes
inline void padtiger512(uint32_t* hash) {
	for (int i = (24/4); i < (64/4); i++) hash[i] = 0;
}

from inline to static inline, otherwise, there will be an error:

Undefined symbols for architecture x86_64:
  "_padtiger512", referenced from:
      _x16rv2_hash in cpuminer-x16rv2.o
ld: symbol(s) not found for architecture x86_64

It still shows the same error on mojave. Any help?

@serambca
Copy link

HI!
I just do it all steps and when launch cpuminer appears the following error in macOS Big Sur. Someone help me?

Failed to get extranonce2_size

Best regards!

@lwheale
Copy link

lwheale commented Apr 17, 2021

If you get
[2021-04-17 01:09:00] stratum_recv_line failed
[2021-04-17 01:09:00] ...retry after 10 seconds

Try and change your worker's password that doesn't include quotes and any other special characters. I created a new worker with a simple password and that fixed the issue.

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