Skip to content

Instantly share code, notes, and snippets.

@quagliero
Last active November 6, 2024 02:10
Show Gist options
  • Select an option

  • Save quagliero/90f493f123c7b1ddba5428ba0146329a to your computer and use it in GitHub Desktop.

Select an option

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

dburlington commented May 7, 2018

Copy link
Copy Markdown

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

When I type : ./autogen.sh

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

@Kezchenko

Copy link
Copy Markdown

Hi,

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

@quagliero

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

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

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

@msettecasse

msettecasse commented May 23, 2018

Copy link
Copy Markdown

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

@quagliero

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

urugn commented Jun 15, 2018

Copy link
Copy Markdown

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

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

twilms commented Oct 27, 2018

Copy link
Copy Markdown

Getting the same error as rorofernandez above. :/

@joseph-turner

Copy link
Copy Markdown

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

@Josh0akley

Copy link
Copy Markdown

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

lasbr commented Jan 3, 2019

Copy link
Copy Markdown

@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

mudruy commented Feb 5, 2019

Copy link
Copy Markdown

@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

thyeem commented Feb 12, 2019

Copy link
Copy Markdown

@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

Tomcatt commented Mar 29, 2019

Copy link
Copy Markdown

Will there be an update to the yescrypt?

@ChrisPtos

ChrisPtos commented Jul 14, 2019

Copy link
Copy Markdown

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
Copy Markdown
Author

@ChrisPtos ...install brew?

@ChrisPtos

Copy link
Copy Markdown

@ChrisPtos ...install brew?

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

@quagliero

quagliero commented Jul 15, 2019

Copy link
Copy Markdown
Author

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

@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

liukun commented Aug 19, 2020

Copy link
Copy Markdown

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
Copy Markdown
Author

Thanks @liukun, have updated the gist.

@francieloliveira

Copy link
Copy Markdown

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
Copy Markdown
Author

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

@antoine78300

Copy link
Copy Markdown

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

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

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

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

lwheale commented Apr 17, 2021

Copy link
Copy Markdown

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