You need to install Homebrew if it is not installed already.
Apple M1 processor officially supported since 6.7.0 release. Native ARM Homebrew is required to build from source.
ARM macOS has the following disadvantages which reduce the hashrate:
Basic build is good for local machine, because it is easy, but if you need to run the miner on other machines please take a look at advanced build.
1. brew install cmake libuv openssl hwloc
2. git clone https://github.com/xmrig/xmrig.git
3. mkdir xmrig/build && cd xmrig/build
4. cmake .. -DOPENSSL_ROOT_DIR=$(brew --prefix openssl)
5. make -j$(sysctl -n hw.logicalcpu)
We use build.hwloc.sh
script to build recent version of hwloc as static library.
1. brew install cmake wget automake libtool autoconf
2. git clone https://github.com/xmrig/xmrig.git
3. mkdir xmrig/build && cd xmrig/scripts
4. ./build.hwloc.sh && cd ../build
5. cmake .. -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DHWLOC_INCLUDE_DIR=../scripts/deps/include -DHWLOC_LIBRARY=../scripts/deps/lib/libhwloc.a
6. make -j$(sysctl -n hw.logicalcpu)
Use command otool -L xmrig
to verify binary dependencies.