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